The App Actions test tool is an Android Studio plugin for developers creating App Actions. During development and testing, you use the App Actions test tool to create a preview of your App Actions in Assistant for your Google account. You can then test how your App Action handles various parameters prior to submitting it for deployment.
What it does
The App Actions test tool parses your actions.xml
file and
creates a preview of your App Actions for a single Google account. These
previews enable Google Assistant to recognize your App Actions before
deploying the production version of your app to the Google Play Console.
For each built-in intent (BII) in your actions.xml
file, the plugin renders a
corresponding JSON-LD object and provides default parameter values. You can then
modify those values to test your App Actions with meaningful parameter
combinations and ensure they perform the correct app functions. You can create,
update, and delete previews in the test tool, letting you iterate and
test your App Actions in a safe environment.
Once you generate a preview, you can trigger an App Action on your test device
directly from the test tool window. For BIIs that are available for
user triggering, you can also use the invocation name directly in Assistant
on your device to try out your App Action. For example, you can say, "Hey
Google, start my exercise using Example App" to launch an App Action that uses
the actions.intent.START_EXERCISE
BII.
Locale support
Preview creation for specific locales in the App Actions test tool varies by BII. The page for each BII in the built-in intent reference provides information on what functionality is available for that BII, like the locales where preview creation in the test tool is available and whether App Actions using that BII are available for users to trigger.
Get the tool
The App Actions test tool is available as a plugin to Android Studio. For information about installing and using Android Studio, see the Android Studio page.
To install the App Actions test tool in Android Studio, do the following:
- Go to File > Settings (Android Studio > Preferences on macOS).
- In the Plugins section, go to Marketplace and search for
App Actions Test Tool
. - Install the tool and restart Android Studio.
You can also download the plugin directly from the JetBrains public repository.
Setup requirements
Using the App Actions test tool requires a number of configuration steps to successfully test your Action. In particular, you need to use the same user account in Android Studio, on your test device, and for Google Play console access.
Prepare your development environment with the following configurations:
- Sign in to Android Studio (version 3.4 or later).
- With the same account, sign in to the Google app on your Android test device.
- With the same account, get Play Console access to the uploaded app package to be tested.
- Open the Google app on your Android test device and finish the initial Assistant setup process.
- Enable device data syncing on your test device.
Limitations
The App Actions test tool has the following limitations:
- App Action previews are only accessible on physical devices. Attempts to trigger an App Action preview on a virtual device are likely to result in the message "Sorry, I couldn't find that."
- App Actions that incorporate web inventory can't be tested directly in the
test tool or by Android debug bridge (
adb
) commands. To test those App Actions, first create a preview using the test tool. Then, trigger those App Actions by interacting with Google Assistant on your physical device. - Inline inventory for the
actions.intent.OPEN_APP_FEATURE
BII can only be tested for a period of six hours after a preview is created or updated. Update the test tool preview or create a new preview to reset the six-hour time period.
Add additional testers
You can invite additional users to your project so they can test your App Actions integration. This is useful when you want to share the project with other members of your development team so they can all test, or when sharing your project with quality assurance (QA) testers in preparation for production launch.
Testers must be added as license testers on the Google Play Store and granted read-only access to Google Play Console.
To add additional testers, follow these steps:
- Sign in to the Play Console.
Follow the instructions under "Set up application licensing" in this Play Console Help topic.
Figure 1. Adding a license tester. Set the license tester’s Gmail account as a Google Play Console read-only user.
- Select User & permissions > Invite new users > Add app.
- In App Access, ensure the Admin (all permissions) checkbox is cleared.
For each tester that you want to enable for preview testing, you must log in separately to Android Studio with that user's Gmail account. Once logged in, use the App Actions test tool to create a preview for the test user.
Use the tool
Access the App Actions test tool in Android Studio by going to Tools > App Actions > App Actions Test Tool or by selecting App Actions Test Tool in the right-click context menu. When you open the tool, the view changes based on whether you have an active test tool preview.
Create, update, and delete previews
Use a draft version of the app for testing. For more information, see Prepare and roll out a release. Test your app in draft mode before submitting it for review.
The test tool creates previews based on your Google account and app package name (application ID), so you can test multiple apps with the same Google account. As long as your application ID is different for each app, you can continue to use the same Google account for preview creation and testing. Multiple Google accounts with access to the same app package can each use the test tool to create separate previews for that app.
To create a preview, do the following in Android Studio:
- Open the App Actions test tool.
- Optionally enter an invocation name and locale for testing. The default
invocation name and locale are
test app action
anden-US
. - Click Create Preview. Once your preview is created, the test tool window
updates to display information about BIIs found in your
actions.xml
file.
The invocation name is used by the test tool to construct and simulate Assistant queries for your App Actions. Deployed App Actions use your Play Store app name for invocation, but you can use any invocation name in the test tool. Use the name of your app as your invocation name in the test tool.
The locale you provide must match the language of Google Assistant on your
test device, and you can only create a preview in one locale at a time. For
example, if your Assistant language is English (US), you can enter en-US
but
not en-**
, en-GB
, or en-US, en-GB
.
To change the invocation name or selected locale for an existing preview, click the Delete Preview button in the test tool. Then, enter the desired invocation name and locale before creating a new preview.
To update an existing preview to match your actions.xml
file, click the
Update Preview button in the test tool. Information about your current
preview is in the Test App Action section of the test tool window.
Configure a BII
Once you create a preview for your app, you can test various parameter
values for BIIs in the plugin. For each BII in your
actions.xml
file, the plugin renders a corresponding
JSON-LD object and provides default parameter values. You can modify those
default values to test your App Actions with meaningful parameter combinations
and ensure they perform the correct app functions.
Parameters and their values typically follow the schema.org
or
schema.googleapis.com
structure for properties and descriptions. You can find
information about any given BII parameter by accessing the schema
type descriptions of a parameter and its higher level parameters as labeled.
For example, the actions.intent.CREATE_MONEY_TRANSFER
BII
supports the intent parameter moneyTransfer.transferMode
. The
schema.googleapis.com
page for MoneyTransfer
lists transferMode
as a
property. The transferMode
property is a mode of transfer, and it expects
values (like SendMoney
) of the enumerated FinancialTransferMode
type. In the
test tool, you can provide either of the enumerations as the value of
transferMode
:
http://schema.googleapis.com/SendMoney
http://schema.googleapis.com/ReceiveMoney
Trigger App Actions
After creating a preview and configuring a BII, you can trigger an App Action on your test device directly from the test tool window.
To trigger an App Action with the test tool, do the following:
- Connect your test device.
- In the Select Target Device section, choose the device where you want to trigger your App Action.
- In the Test App Action section, click the Run button.
App Actions triggered in the test tool use the displayed
Android Debug Bridge (adb
) command. The generated adb
shell command
includes all the metadata required by the Google app to execute a BII.
This approach mimics the behavior of your App Action after Assistant
extracts key pieces of information from a query.
Android Studio logging
Logs specific to the test tool are available in the Android Studio log files, not as Logcat output. Android Studio logs are generated by processes running directly on your workstation, and you can use them to troubleshoot test tool operations like creating, updating, or deleting a preview.
To access your Android Studio log files, go to Help > Show log in explorer (Help > Show log in finder on macOS).
Logs related to App Actions for your app are available in Logcat. Logcat captures logs from virtual or physical devices connected to Android Studio.
To get App Actions logs for your device, follow these steps:
- Access your Logcat log messages by clicking Logcat in the Android Studio tool window bar.
- Search for logs that include
ActivityTaskManager
.
Get support and additional resources
The App Actions test tool assistant provides links to documentation, codelabs, and other resources for learning and getting help using the test tool.
You can open the assistant in Android Studio by choosing Tools > App Actions > Help.