Instrumented Tests with Genymotion SaaS and gmsaas

2024-04-23

This tutorial explains how to automate instrumented tests from your desktop. This tutorial explains how to run instrumented tests locally using the command line tool gmsaas for Genymotion SaaS. Please refer to the gmsaas user guide for installation and usage.

Important

You must be authenticated with an API Token. Please refer to the gmsaas user guide for detailed instructions.

1. Create and start your instance

Use the following command:

gmsaas instances start <RECIPE_UUID> <INSTANCE_NAME>

<RECIPE_UUID> is the recipe identifier. <INSTANCE_NAME> is the name you wish to give to the instance. Once up, the command returns and shows the <INSTANCE_UUID>.

2. Connect the instance to ADB

Run the following command:

gmsaas instances adbconnect <INSTANCE_NAME> [--adb-serial-port <VALUE>]

3. Run your instrumented tests

You can use Gradle CLI or Android Studio:

You can view your tests running in the virtual device by signing in to Genymotion SaaS.

4. Stop the virtual devices

Use the following command:

gmsaas instances stop <INSTANCE_UUID>

<INSTANCE_UUID> is the UUID (not the name!) of the instance used for the test. All data generated on the virtual device during the tests are destroyed.