# Commands
The --help
option is suitable for every gmsaas
commands. It will provide you with all the supported commands, sub-commands, options, and a quick explanation of what those do.
# List recipes
A recipe is a template with a given Android version, display size, density and specifications (CPU, memory, storage) which generally match those of a real device.
gmsaas recipes list
Default output: recipes list formatted as a table
JSON output:
# Start an instance
Warning
Time out will not apply to instances launched with this command (see Administration interface - Settings). To avoid extra charges, the instance must be stopped from the Web user interface or using the stop command.
gmsaas instances start [--no-wait] <recipe_uuid> <name>
Creates and start an instance based on the specified <recipe_uuid>
recipe (cf. previous section). <name>
is the name you wish to give to the instance. The command returns to shell once the instance is started, unless the --no-wait
option has been set.
Important
Please note that you need to use the <instance_uuid>
to refer to an instance when issuing commands via gmsaas. <name>
is only use as a tag for convenience.
Default output:
<instance_uuid>
is printed$ gmsaas instances start b9cf7b2c-4d11-4777-97c7-29d3b5c68d59 test 62ec330e-47d2-4a6b-939f-122718505329
JSON output:
# Get instance information 1.6.0+
gmsaas instances get <instance_uuid>
Default output: instance information formatted as a table. This also provides the ADB serial used if the instance is connected to ADB.
JSON output:
$ gmsaas --format json instances get 5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7
{
"instance": {
"uuid": "5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7",
"name": "test1",
"state": "ONLINE",
"adbtunnel_state": "CONNECTED",
"adb_serial": "localhost:39745",
"adb_serial_port": 39745,
"recipe": {
"uuid": "b9cf7b2c-4d11-4777-97c7-29d3b5c68d59",
"name": "Samsung Galaxy S8",
"android_version": "8.0",
"screen_width": 1440,
"screen_height": 2960,
"screen_density": 480,
"screen": "1440 x 2960 dpi 480",
"source": "genymotion"
}
},
"exit_code": 0,
"exit_code_desc": "NO_ERROR"
}
# List instances
gmsaas instances [--quiet/-q] list
Default output: 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.JSON output:
# Connect an instance to ADB
gmsaas instances adbconnect [--adb-serial-port PORT] <instance_uuid>
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>
.
Note
To easily connect all your running instances to ADB, you can combine this command with the --quiet
or -q
option and xargs
.
For example:
gmsaas instances list -q | xargs -n1 gmsaas instances adbconnect
Default output:
<adb_serial>
on which ADB is connected is printed. 1.5.0+$ gmsaas instances adbconnect ab47b279-05ef-4496-9e45-bc6af0085122 localhost:40249
JSON output:
# 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.
gmsaas instances stop [--no-wait] <instance_uuid>
Stops the specified instance. The command returns to shell once the instance is fully stopped, unless the --no-wait
option is set.
Note
To easily stop all your running instances, you can combine this command with --quiet
or -q
option and xargs
.
For example:
gmsaas instances list -q | xargs -n1 gmsaas instances stop --no-wait
Default output: Nothing printed
JSON output:
← Get started Issues →