gmsaas Commands

The --help/-h option is suitable for every gmsaas command. It provides all supported commands, sub-commands, options, and a quick explanation of what they do.

All commands documented here require gmsaas 1.14.1 or above. Versions prior to 1.14.1 have been yanked from PyPI and are no longer available.

Hardware Profiles

Hardware Profiles define virtual device hardware specifications, such as screen resolution, form factor, and so on.

CPU and RAM may be limited by the current Genymotion SaaS plan. Contact Genymotion SaaS for custom configuration.

Create a Hardware Profile

<hwprofile_uuid> is printed.

gmsaas hwprofiles create <name> \
  [--width INTEGER] \
  [--height INTEGER] \
  [--density INTEGER] \
  [--form-factor PHONE|TABLET] \
  [--navigation-bar]

Get Hardware Profile details

The Hardware Profile formatted as a table.

gmsaas hwprofiles get <hwprofile_uuid>

The output includes fields: UUID, NAME, DISPLAY, SOURCE.

List Hardware Profiles

hwprofiles list

The Hardware Profile list formatted as a table.

gmsaas hwprofiles list

The output includes fields: UUID, NAME, DISPLAY, SOURCE.

Delete a Hardware Profile

gmsaas hwprofiles delete <hwprofile_uuid>

Images

Images are virtual device Android OS disk images.

Clone an Image

<osimage_uuid> is printed.

gmsaas osimages clone <base_osimage_uuid> <name>

Get Image details

Image is printed as a table.

gmsaas osimages get <osimage_uuid>

The output includes fields: UUID, NAME, ANDROID VERSION, API VERSION, ARCH, SOURCE.

List Images

osimages list

Image list formatted as a table.

gmsaas osimages list

The output includes fields: UUID, NAME, ANDROID VERSION, API VERSION, ARCH, SOURCE.

Delete an Image

gmsaas osimages delete <osimage_uuid>

Recipes

Recipes are a combination of Hardware Profiles and Images.

Create a Recipe

gmsaas recipes create <hwprofile_uuid> <osimage_uuid> <name>

Get Recipe details

Recipe is printed as a table.

gmsaas recipes get <recipe_uuid>

The output includes fields: UUID, NAME, ANDROID, SCREEN, ARCH, SOURCE.

List Recipes

Recipe list formatted as a table.

gmsaas recipes list [--name FILTER_TEXT]

gmsaas recipes list [--name FILTER_TEXT] [--source all|official|custom]

The output is a table with fields: UUID, NAME, ANDROID, SCREEN.

Delete a Recipe

gmsaas recipes delete <recipe_uuid> [--delete-osimage] [--delete-hwprofile]

Instances

Start an instance based on the specified <recipe_uuid> recipe. <name> is the name to give to the instance.

The command returns to shell once the instance is started. The command returns to shell immediately unless the --no-wait option has been set.

--max-run-duration is the global timeout in minutes. Instances automatically stop once the maximum duration is reached.

> Warning: Use the <instance_uuid> to refer to an instance when issuing commands via gmsaas. <name> is only use as a tag for convenience.

Start an Instance

gmsaas instances start <recipe_uuid> <name> [--no-wait] [--max-run-duration INTEGER]

<instance_uuid> is printed.

Get Instance details

Instance information formatted as a table. This also provides the ADB serial used if the instance is connected to ADB.

gmsaas instances get <instance_uuid>

List Instances

Instances list formatted as a table. This also provides the ADB serial used if the instance is connected to ADB.

If --quiet is set, only instance UUIDs will be displayed.

gmsaas instances list [--quiet/-q]

Connect an Instance to ADB

Connects a running instance to ADB. The command returns to shell once ADB is connected.

If the --adb-serial-port <PORT> option is set, the instance will be connected to ADB on localhost:<PORT>.

gmsaas instances adbconnect [--adb-serial-port <PORT>] <instance_uuid>

New in 1.16.0

The <instance_uuid> argument is now optional. If omitted, the command connects the single ONLINE instance.

An error is raised if zero or more than one instance is ONLINE.

<adb_serial> (URL:port) on which ADB is connected is printed.

Disconnect an Instance from ADB

Disconnects a running instance from ADB.

If no <instance_uuid> is given, all currently connected instances are disconnected.

gmsaas instances adbdisconnect [<instance_uuid>]

New in 1.16.0

The <instance_uuid> argument is optional since version 1.16.0.

When omitted, all connected instances are disconnected.

Save an Instance

Changes are not automatically saved. Any modification to a virtual device has to be saved manually through this command.

> Warning: The instance will be stopped in order to be saved.

Only Instances started from owned Recipes with owned Images can be saved with this command. Use the saveas command otherwise.

gmsaas instances save <instance_uuid>

"Save As" an Instance

You can save an instance as a new custom recipe.

gmsaas instances saveas <instance_uuid> \
  --osimage-name <image_name> \
  --recipe-name <recipe_name>

> Warning: The instance will be stopped in order to be saved.

Stop an Instance

> Warning: Instances launched with gmsaas will not stop until this command is issued, or it is stopped from the Web user interface. If you forget to do so, your credit will be deducted as long as the instance is running and you may get extra charges.

Stops the specified instance. The command returns to shell once the instance is fully stopped. The command returns to shell immediately unless the --no-wait option is set.

gmsaas instances stop [--no-wait] <instance_uuid>

> Tip: To easily stop all your running instances, combine this command with --quiet or -q and xargs.

Example:

gmsaas instances list -q | xargs -n1 gmsaas instances stop --no-wait

No output.

Access an Instance display (gmsaas portal)

Copy to the clipboard a generated URL pointing to a local web page (gmsaas portal). The gmsaas portal can display the instances passed as parameters or all running instances.

Only running instances are displayed.

gmsaas instances display [<instance_uuid>, ...] [--yes]

gmsaas prompts to confirm copying sensitive data, such as the token, to the clipboard. The prompt appears unless --yes option is set.

The number of instances displayed in the portal is limited to 30.

Paste the generated URL into a web browser address bar to open the gmsaas portal.

Setting Up and Tearing Down ADB

The gmsaas tool uses an internal component called ADB Tunnel. ADB Tunnel enables secure ADB connections to instances.

If frequent failures occur with the gmsaas instances adbconnect command, consider using the gmsaas adb start and gmsaas adb stop commands to manage ADB connections more reliably instead.

Recommended flow for test runs

1. Install gmsaas 2. Configure the SDK path:

   gmsaas config set android-sdk-path <path>
   
3. Authenticate using your API token:
   gmsaas auth token <token>
   
4. Start the ADB stack before running tests:
   gmsaas adb start
   
5. Run your test suite. 6. Stop the ADB stack after tests complete:
   gmsaas adb stop
   
7. Unauthenticate when finished:
   gmsaas auth reset
   

This workflow can help prevent connectivity issues by ensuring proper ADB environment during intensive usage.

Start ADB

gmsaas adb start

This starts both ADB server and ADB Tunnel server.

Stop ADB

gmsaas adb stop

This stops both ADB server and ADB Tunnel server.

Admin

Get Usage Report

Returns the usage report for the current organization. The report is broken down per user for the specified time period.