# Simulator

The simulator in the [Actions console](https://console.actions.google.com) 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.

> [!NOTE]
> **Note:** If you have unsaved changes to your fulfillment code in the inline editor and navigate to the simulator, you are prompted to deploy the changes to your code or use the previously saved and deployed code.

## 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](https://developers.google.com/assistant/console/simulator#select_a_version).

> [!NOTE]
> **Note:** When you're ready to submit your project for approval, the current state of your project's draft is assigned a version, and the state of the project is immutable. Future changes you make apply to the draft version of your project, which you then resubmit for approval as a new version.

## Input methods

You can click the button in the response text field to specify the input method
for testing.

![](https://developers.google.com/static/assistant/console/images/simulator/input.png)

The following list describes the input types and the [devices](https://developers.google.com/assistant/console/simulator#specify_a_device)
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`](https://developers.google.com/assistant/conversational/reference/rest/Shared.Types/AppRequest#rawinput)
object as an [`inputType`](https://developers.google.com/assistant/conversational/reference/rest/Shared.Types/InputType)
field.

      {
      "inputType": "VOICE",
      "query": "Tell me a fact about Google's headquarters"
      }

> [!NOTE]
> **Note:** While the simulator lets you type responses for devices that don't actually have the keyboard input method (Smart Display, Speaker), the `inputType` field still correctly shows a value of `VOICE`.

## 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:

1. Click the device drop-down in the upper left corner. **Smart Display** is
   selected by default.

   ![](https://developers.google.com/static/assistant/console/images/simulator/options.png)
2. 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](https://developers.google.com/assistant/surfaces/feature-entry-level-phones#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](https://developers.google.com/assistant/console/localization) for more
information on creating multi-language Actions.

> [!NOTE]
> **Note:** When changing the language settings, the invocation phrase to invoke your Action changes to the corresponding language.

## 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](https://developers.google.com/assistant/conversational/df-asdk/helpers#user_information)
to ask the user for permission to access it.

> [!NOTE]
> **Note:** See the [localization documentation](https://developers.google.com/assistant/console/localization) for more information on creating multi-region Actions.

## 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:

1. In the simulator, click the **Settings** button in the upper right corner.

2. 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.

![](https://developers.google.com/static/assistant/console/images/simulator/version.png)

### 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](https://developers.google.com/assistant/console/simulator#select_a_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.

> [!NOTE]
> **Note:** The Test URL setting only determines what webhook the simulator calls when testing. The setting is not intended to support end users testing your Actions outside the simulator.

**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:**

1. In the upper right corner of the simulator, click **Settings**.

2. Enable **Test URL**.

3. 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](https://developers.google.com/assistant/identity) allows your Action to utilize
[Google Sign-In](https://developers.google.com/assistant/identity/google-sign-in),
[OAuth-based Google Sign-in "Streamlined" linking](https://developers.google.com/assistant/identity/google-sign-in-oauth),
or [OAuth](https://developers.google.com/assistant/identity/oauth2).

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:

1. In the Actions console simulator, enter "talk to my test app" in the input
   area of the simulator to test your Action.

   > [!NOTE]
   > **Note:** If you've already specified an invocation name and saved your invocation information, you can start the conversation by saying *"Talk to
   > \<invocation name\>"* instead.

2. Send a query initializing your Action's account linking flow.

3. Sign in using the prompt.

   > [!NOTE]
   > **Note:** The simulator presents a Google Sign-in modal dialog if the test user has multiple accounts. If the test user only has one account, that account is used automatically. Make sure pop-ups are not blocked by your browser.

4. 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.

![](https://developers.google.com/static/assistant/console/images/simulator/on-device-testing.png)

### Audio playback

Toggle this option to mute or enable audio playback during testing.

![](https://developers.google.com/static/assistant/console/images/simulator/audio-playback.png)

### Development Sandbox

When you enable this option, payment methods are not charged. See the
[transactions documentation](https://developers.google.com/assistant/transactions) for more information.

![](https://developers.google.com/static/assistant/console/images/simulator/development-sandbox.png)

### Simulate unverified users

This option simulates when a user is on a device where Voice Match is set for someone else.

![](https://developers.google.com/static/assistant/console/images/simulator/simulate-unverified-users.png)