The simulator in the Actions console lets you test your Action through an easy-to-use web interface that simulates hardware devices and their settings. You can also access debug information such as the request and response that your fulfillment receives and sends.
Test a project
When testing your Actions project, the following restrictions apply:
- Actions are testable for up to 30 days. After 30 days, you have to create a new version for testing.
- In-development Actions can be tested on any supported hardware device (Android 6.0+, iOS 9.1+, and voice-activated speakers). The device must be logged into the same Google account you use in the Actions console. Saying "OK Google, talk to my test app" invokes the current draft version of your Action.
- By default, the simulator uses the version of your Action that's in Draft. See how to select another version to test.
Input methods
You can click the button in the response text field to specify the input method for testing.
The following list describes the input types and the devices they're available on:
- Auto detect - Automatically detect voice, keyboard, or touch input.
- Touch - Used for interactive experiences and elements, like suggestion chips. Available for Smart Display and Phone devices.
- Voice - Used for voice-only input. Available for Smart Display, Phone, and Speaker devices.
- Keyboard - Used for text-only input. Available for Phone devices.
The default input method is auto-detect. Based on the surface you select, input types are also disabled and enabled accordingly.
The input method is included in every request to your fulfillment in the
RawInput
object as an inputType
field.
{
"inputType": "VOICE",
"query": "Tell me a fact about Google's headquarters"
}
Specify a device
The simulator can mimic different devices and allow you to test your Action's device-specific experiences.
To change the simulated device, follow these steps:
Click the device drop-down in the upper left corner. Smart Display is selected by default.
Choose from the following devices to simulate:
- Smart Display - Assistant-enabled devices like the Nest Hub that have display and speaker capabilities.
- Phone - Assistant-enabled phones that have display and speaker capabilities.
- Speaker - Assistant-enabled smart speaker that has speaker capabilities.
- KaiOS - Assistant-enabled phones using KaiOS.
Select a language
You can select a language from the second drop-down menu to set the language and region that you want to simulate. See the localization documentation for more information on creating multi-language Actions.
Set a location
You can manually set the coordinates and address of the device. This feature lets you test any location-targeting features that you've set in the console and region-specific responses that you've configured in your fulfillment.
To obtain the simulated location for use in your Action, use the user information helper to ask the user for permission to access it.
Settings
Click the Settings button in the upper left to access additional options for the simulator.
Select a version
You can specify the Actions project version that you want to test (either published or draft versions). To select the project version, follow these steps:
In the simulator, click the Settings button in the upper right corner.
Click the drop-down next to Select a version and choose a version to test.
In the version drop-down menu, select the version of your Actions project that you want to test and click DONE. You see all of the versions that you've submitted in addition to a Draft version, which signifies the current state of your project before submission.
Test URL
To avoid changes to your production environment when you want to test your Actions project, you can provide a distinct URL to use in place of your production webhook. Test URLs are configured per version of an Actions project. One Actions project can have multiple versions with unique test URLs, allowing you to test multiple versions of your Action in the simulator without impacting production.
When the Test URL setting is enabled, the simulator overrides the production webhook URL for your Actions project and instead uses the test webhook URL that you provided.
Before you configure a test URL in the simulator:
Determine the URL that you want to use for testing a version of your Actions project.
Configure the server that you want to use for testing to accept requests at the URL.
To configure a test URL in the simulator:
In the upper right corner of the simulator, click Settings.
Enable Test URL.
In the Test URL box, type the URL that you want to use for testing.
The test URL that you specified is displayed in the simulator.
Account linking
Account linking allows your Action to utilize Google Sign-In, OAuth-based Google Sign-in "Streamlined" linking, or OAuth.
If you haven't set up account linking for your Action, click Set up account linking under Settings to go to the Account linking section of the console.
To link an account, follow these steps:
In the Actions console simulator, enter "talk to my test app" in the input area of the simulator to test your Action.
Send a query initializing your Action's account linking flow.
Sign in using the prompt.
Confirm account linking was successful.
The linked account persists until the account is unlinked, so you can update the Action while using the same linked account.
To unlink an account, click Settings > Unlink under Account linking.
On-device testing
This setting allows you to enable or disable testing on a physical device. In order to test on a device, you need to be logged into the same account you used to create the Actions on Google project.
Audio playback
Toggle this option to mute or enable audio playback during testing.
Development Sandbox
When you enable this option, payment methods are not charged. See the transactions documentation for more information.
Simulate unverified users
This option simulates when a user is on a device where Voice Match is set for someone else.