April 23, 2024
This tutorial explains how to automate your instrumented tests from your desktop and run them locally using the command line tool gmsaas for Genymotion SaaS. Please refer to gmsaas user guide for installation and usage.
> Important You must be authenticated with an API Token. Please refer to 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 and <INSTANCE_NAME> is the name you wish to give to the instance. Once up, the command returns and shows the <INSTANCE_UUID>.
Note The list of available recipes can be retrieved using this command:
gmsaas recipes list
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 gradlew CLI or AndroidStudio:
./gradlew connectedAndroidTest
AndroidStudio in Gradle toolbox: Tasks > verification > connectedAndroidTest
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.