gmsaas Commands

The gmsaas command-line interface (CLI) provides a set of commands to manage hardware profiles, images, recipes, and instances. It also includes operations to connect to ADB, save instances, and access the gmsaas portal.

Create a Hardware Profile

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

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

Default output JSON output

<hwprofile_uuid> is printed.

$ gmsaas hwprofiles create test 3aa57c4c-1372-4d82-8405-2ab668805b3c $

{ "hwprofile" : { "uuid" : "3aa57c4c-1372-4d82-8405-2ab668805b3c" , "name" : "test" , "form_factor" : "PHONE" , "cpu_count" : 2 , "ram_size" : 2048 , "data_disk_size" : 16384 , "source" : "a@b.c" , "display_settings" : { "hw_navigation_keys" : true , "displays" : [ { "width" : 768 , "height" : 1280 , "density" : 320 , "screen" : "768 x 1280 dpi 320" } ] } }, "exit_code" : 0 , "exit_code_desc" : "NO_ERROR" }


## Get Hardware Profile details
The Hardware Profile formatted as a table.

$ gmsaas hwprofiles get <hwprofile_uuid>

Default output
JSON output

The Hardware Profile formatted as a table.

UUID NAME DISPLAY SOURCE ------------------------------------ ------ ------------------ -------- 3aa57c4c-1372-4d82-8405-2ab668805b3c test 768 x 1280 dpi 320 a@b.c

{
"hwprofile"
:
{
"uuid"
:
"3aa57c4c-1372-4d82-8405-2ab668805b3c"
,
"name"
:
"test"
,
"form_factor"
:
"PHONE"
,
"cpu_count"
:
2
,
"ram_size"
:
2048
,
"data_disk_size"
:
16384
,
"source"
:
"a@b.c"
,
"display_settings"
:
{
"hw_navigation_keys"
:
true
,
"displays"
:
[
{
"width"
:
768
,
"height"
:
1280
,
"density"
:
320
,
"screen"
:
"768 x 1280 dpi 320"
}
]
}
},
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

List Hardware Profiles

The Hardware Profile list formatted as a table.

$ gmsaas hwprofiles list

Default output JSON output

UUID NAME DISPLAY SOURCE ------------------------------------ ----------------------- ------------------- ---------- ... e104f058-b291-4764-8e0d-d9ff78a41192 Custom Phone 768 x 1280 dpi 320 genymotion c65db329-511a-4c2a-9761-c7259649e8c7 Custom Tablet 1536 x 2048 dpi 320 genymotion c6e1222c-993e-4bf2-840f-4795792f2143 Google Nexus 10 2560 x 1600 dpi 320 genymotion 55fddf0b-0e56-4742-8791-106ad93c01ff Google Nexus 4 768 x 1280 dpi 320 genymotion ...


{
"hwprofiles"
:
[
{
"uuid"
:
"e104f058-b291-4764-8e0d-d9ff78a41192"
,
"name"
:
"Custom Phone"
,
"form_factor"
:
"PHONE"
,
"cpu_count"
:
4
,
"ram_size"
:
2048
,
"data_disk_size"
:
8192
,
"source"
:
"genymotion"
,
"display_settings"
:
{
"hw_navigation_keys"
:
false
,
"displays"
:
[
{
"width"
:
768
,
"height"
:
1280
,
"density"
:
320
,
"screen"
:
"768 x 1280 dpi 320"
}
]
}
},
...
],
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

Delete a Hardware Profile

$ gmsaas hwprofiles delete <hwprofile_uuid>

Default output JSON output

$ gmsaas hwprofiles delete a0d9acf6-08e8-400c-93a5-b44cc666506b
HwProfile 'a0d9acf6-08e8-400c-93a5-b44cc666506b' deleted successfully.

{ "hwprofile_uuid" : "a0d9acf6-08e8-400c-93a5-b44cc666506b" , "exit_code" : 0 , "exit_code_desc" : "NO_ERROR" }


## Clone an Image
Images are virtual device Android OS disk images.

$ gmsaas osimages clone <base_osimage_uuid> <name>

Default output
JSON output

<osimage_uuid>

$ gmsaas osimages clone 0c15f956-55a9-4622-a2a0-cfaaedd3a0e9 test
6cb23b1a-f6c6-4c0d-90d7-60e184f7670f

{
"osimage"
:
{
"uuid"
:
"6cb23b1a-f6c6-4c0d-90d7-60e184f7670f"
,
"name"
:
"test"
,
"image_version"
:
"3.0.2"
,
"android_version"
:
"13.0"
,
"api_version"
:
33
,
"architecture"
:
"x86_64"
,
"source"
:
"a@b.c"
},
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

Get Image details

$ gmsaas osimages get <osimage_uuid>

Default output JSON output

Image is printed as a table.

1.12.0
1.8.0

$ gmsaas osimages get 6cb23b1a-f6c6-4c0d-90d7-60e184f7670f UUID NAME ANDROID VERSION API VERSION ARCH SOURCE ------------------------------------ ------ ----------------- ------------- ------ -------- 6cb23b1a-f6c6-4c0d-90d7-60e184f7670f test 13 33 x86_64 a@b.c $


{
"osimage"
:
{
"uuid"
:
"6cb23b1a-f6c6-4c0d-90d7-60e184f7670f"
,
"name"
:
"test"
,
"image_version"
:
"3.0.2"
,
"android_version"
:
"13.0"
,
"api_version"
:
33
,
"architecture"
:
"x86_64"
,
"source"
:
"a@b.c"
,
"status"
:
"READY"
,
"is_beta"
:
false
},
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

List Images

$ gmsaas osimages list

Default output JSON output

Image list formatted as a table. 1.12.0 1.8.0 UUID NAME ANDROID VERSION API VERSION ARCH SOURCE ------------------------------------ ------------ ----------------- ------------- ------ ---------- ... 76c72a27-b6a0-48e7-864c-1e6806ed1127 Android 12 .0 12 .0 31 x86_64 genymotion c4496482-c5e4-466d-8f59-7b1ac6d1600a Android 12 .1 12 .1 32 x86_64 genymotion 0c15f956-55a9-4622-a2a0-cfaaedd3a0e9 Android 13 .0 13 .0 33 x86_64 genymotion ...


{
"osimages"
:
[
{
"uuid"
:
"0c15f956-55a9-4622-a2a0-cfaaedd3a0e9"
,
"name"
:
"Android 13.0"
,
"image_version"
:
"3.0.2"
,
"android_version"
:
"13.0"
,
"api_version"
:
33
,
"architecture"
:
"x86_64"
,
"source"
:
"genymotion"
,
"status"
:
"READY"
,
"is_beta"
:
false
},
...
],
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

{ "osimages" : [ { "uuid" : "0c15f956-55a9-4622-a2a0-cfaaedd3a0e9" , "name" : "Android 13.0" , "image_version" : "3.0.2" , "android_version" : "13.0" , "api_version" : 33 , "architecture" : "x86_64" , "source" : "genymotion" }, ... ], "exit_code" : 0 , "exit_code_desc" : "NO_ERROR" }


## Delete an Image
$ gmsaas osimages delete <osimage_uuid>

Default output
JSON output

$ gmsaas osimages delete 6cb23b1a-f6c6-4c0d-90d7-60e184f7670f Image '6cb23b1a-f6c6-4c0d-90d7-60e184f7670f' deleted successfully.

{
"osimage_uuid"
:
"6cb23b1a-f6c6-4c0d-90d7-60e184f7670f"
,
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

Create a Recipe

Recipes are a combination of Hardware Profiles and Images.

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

Default output JSON output

$ gmsaas recipes create e104f058-b291-4764-8e0d-d9ff78a41192 0c15f956-55a9-4622-a2a0-cfaaedd3a0e9 test
012332c0-ea89-49b3-b0cb-3b6066d046ad

{ "recipe" : { "uuid" : "6bc927c9-777e-471c-af5b-6dc737f3aaef" , "name" : "test" , "source" : "a@b.c" , "hwprofile" : { "uuid" : "e104f058-b291-4764-8e0d-d9ff78a41192" , "name" : "Custom Phone" , "form_factor" : "PHONE" , "source" : "genymotion" , "display_settings" : { "hw_navigation_keys" : false , "displays" : [ { "width" : 768 , "height" : 1280 , "density" : 320 , "screen" : "768 x 1280 dpi 320" } ] } }, "osimage" : { "uuid" : "0c15f956-55a9-4622-a2a0-cfaaedd3a0e9" , "name" : "Android 13.0" , "android_version" : "13.0" , "api_version" : 33 , "architecture" : "x86_64" , "source" : "genymotion" } }, "exit_code" : 0 , "exit_code_desc" : "NO_ERROR" } $ gmsaas recipes get <recipe_uuid> Default output JSON output

Recipe is printed as a table.

1.12.0
1.8.0

$ gmsaas recipes get 6bc927c9-777e-471c-af5b-6dc737f3aaef UUID NAME ANDROID SCREEN ARCH SOURCE ------------------------------------ ------ --------- ------------------ ------ -------- 6bc927c9-777e-471c-af5b-6dc737f3aaef test 13 768 x 1280 dpi 320 a@b.c


{
"recipe"
:
{
"uuid"
:
"6bc927c9-777e-471c-af5b-6dc737f3aaef"
,
"name"
:
"test"
,
"android_version"
:
"13.0"
,
"screen_width"
:
768
,
"screen_height"
:
1280
,
"screen_density"
:
320
,
"screen"
:
"768 x 1280 dpi 320"
,
"source"
:
"a@b.c"
,
"hwprofile"
:
{
"uuid"
:
"e104f058-b291-4764-8e0d-d9ff78a41192"
,
"name"
:
"Custom Phone"
,
"form_factor"
:
"PHONE"
,
"cpu_count"
:
4
,
"ram_size"
:
2048
,
"source"
:
"genymotion"
,
"display_settings"
:
{
"hw_navigation_keys"
:
false
,
"displays"
:
[
{
"width"
:
768
,
"height"
:
1280
,
"density"
:
320
,
"screen"
:
"768 x 1280 dpi 320"
}
]
}
},
"osimage"
:
{
"uuid"
:
"0c15f956-55a9-4622-a2a0-cfaaedd3a0e9"
,
"name"
:
"Android 13.0"
,
"android_version"
:
"13.0"
,
"api_version"
:
33
,
"architecture"
:
"x86_64"
,
"source"
:
"genymotion"
,
"is_beta"
:
false
}
},
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

List Recipes

$ gmsaas recipes list
[
--name
FILTER_TEXT
]

Default output JSON output

Recipe list formatted as a table. 1.12.0 1.8.0

$ gmsaas recipes list UUID NAME ANDROID SCREEN ARCH SOURCE ------------------------------------ ----------------------------- --------- ------------------- ------ ---------- ... e104f058-b291-4764-8e0d-d9ff78a41192 Custom Phone 11 .0 768 x 1280 dpi 320 x86_64 genymotion c65db329-511a-4c2a-9761-c7259649e8c7 Custom Tablet 11 .0 1536 x 2048 dpi 320 x86_64 genymotion 95016679 -8f8d-4890-b026-e4ad889aadf1 Google Pixel 3a 11 .0 1080 x 2220 dpi 420 x86_64 genymotion ...


{
"recipes"
:
[
{
"uuid"
:
"e104f058-b291-4764-8e0d-d9ff78a41192"
,
"name"
:
"Custom Phone"
,
"android_version"
:
"11.0"
,
"screen_width"
:
768
,
"screen_height"
:
1280
,
"screen_density"
:
320
,
"screen"
:
"768 x 1280 dpi 320"
,
"source"
:
"genymotion"
,
"hwprofile"
:
{
"uuid"
:
"e104f058-b291-4764-8e0d-d9ff78a41192"
,
"name"
:
"Custom Phone"
,
"form_factor"
:
"PHONE"
,
"cpu_count"
:
4
,
"ram_size"
:
2048
,
"source"
:
"genymotion"
,
"display_settings"
:
{
"hw_navigation_keys"
:
false
,
"displays"
:
[
{
"width"
:
768
,
"height"
:
1280
,
"density"
:
320
,
"screen"
:
"768 x 1280 dpi 320"
}
]
}
},
"osimage"
:
{
"uuid"
:
"3e7e013f-a45c-4972-995d-8cdd885059c4"
,
"name"
:
"Android 11.0"
,
"image_version"
:
"0.0.0"
,
"android_version"
:
"11.0"
,
"api_version"
:
30
,
"architecture"
:
"x86_64"
,
"source"
:
"genymotion"
,
"is_beta"
:
false
},
},
...
],
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}
$
gmsaas
--
f
orma
t
jso
n
i
nstan
ces
list
{
"recipes"
:
[
{
"uuid"
:
"e104f058-b291-4764-8e0d-d9ff78a41192"
,
"name"
:
"Custom Phone"
,
"android_version"
:
"11.0"
,
"screen_width"
:
768
,
"screen_height"
:
1280
,
"screen_density"
:
320
,
"screen"
:
"768 x 1280 dpi 320"
,
"source"
:
"genymotion"
,
"hwprofile"
:
{
"uuid"
:
"e104f058-b291-4764-8e0d-d9ff78a41192"
,
"name"
:
"Custom Phone"
,
"form_factor"
:
"PHONE"
,
"cpu_count"
:
4
,
"ram_size"
:
2048
,
"source"
:
"genymotion"
,
"display_settings"
:
{
"hw_navigation_keys"
:
false
,
"displays"
:
[
{
"width"
:
768
,
"height"
:
1280
,
"density"
:
320
,
"screen"
:
"768 x 1280 dpi 320"
}
]
}
},
"osimage"
:
{
"uuid"
:
"3e7e013f-a45c-4972-995d-8cdd885059c4"
,
"name"
:
"Android 11.0"
,
"android_version"
:
"11.0"
,
"api_version"
:
30
,
"architecture"
:
"x86_64"
,
"source"
:
"genymotion"
},
},
...
],
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

{ "recipes" : [ { "uuid" : "e104f058-b291-4764-8e0d-d9ff78a41192" , "name" : "Custom Phone" , "android_version" : "11.0" , "screen_width" : 768 , "screen_height" : 1280 , "screen_density" : 320 , "screen" : "768 x 1280 dpi 320" , "source" : "genymotion" }, ... ], "exit_code" : 0 , "exit_code_desc" : "NO_ERROR" }


## Delete a Recipe
$ gmsaas recipes delete <recipe_uuid> [ --delete-osimage ] [ --delete-hwprofile ]

Default output
JSON output

$ gmsaas recipes delete 6bc927c9-777e-471c-af5b-6dc737f3aaef Recipe '6bc927c9-777e-471c-af5b-6dc737f3aaef' deleted successfully.

{
"recipe_uuid"
:
"6bc927c9-777e-471c-af5b-6dc737f3aaef"
,
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

Start an Instance

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

Creates and start an instance based on the specified <recipe_uuid> recipe (cf. previous commands). <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. --max-run-duration is the global timeout in minutes, the instances will automatically stop once reached.

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

Default output JSON output

<instance_uuid> is printed.

$ gmsaas instances start b9cf7b2c-4d11-4777-97c7-29d3b5c68d59 test 62ec330e-47d2-4a6b-939f-122718505329 $


{
"instance"
:
{
"uuid"
:
"62ec330e-47d2-4a6b-939f-122718505329"
,
"name"
:
"test"
,
"created_at"
:
"2021-05-29T11:54:35.000Z"
,
"max_run_duration"
:
1440
,
"max_inactivity_duration"
:
0
,
"state"
:
"ONLINE"
,
"adbtunnel_state"
:
"DISCONNECTED"
,
"adb_serial"
:
"0.0.0.0"
,
"adb_serial_port"
:
0
,
"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"
,
"hwprofile"
:
{
"uuid"
:
"f34de94f-1e85-4d61-9b0d-c47968bc156c"
,
"name"
:
"Samsung Galaxy S8"
,
"form_factor"
:
"PHONE"
,
"cpu_count"
:
4
,
"ram_size"
:
4096
,
"data_disk_size"
:
32768
,
"source"
:
"genymotion"
,
"display_settings"
:
{
"hw_navigation_keys"
:
false
,
"displays"
:
[
{
"width"
:
1440
,
"height"
:
2960
,
"density"
:
480
,
"screen"
:
"1440 x 2960 dpi 480"
}
]
}
},
"osimage"
:
{
"uuid"
:
"f29482b4-10ba-4e89-83d3-b5919a34a484"
,
"name"
:
"Android 8.0 (Oreo)"
,
"image_version"
:
"2.17.0"
,
"android_version"
:
"8.0"
,
"api_version"
:
26
,
"architecture"
:
"x86"
,
"source"
:
"genymotion"
,
"is_beta"
:
false
}
}
},
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}
$

Get Instance details

The 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>

Default output JSON output

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

UUID
NAME
ADB
SERIAL
STATE
------------------------------------
------------------
------------
--------
e5771dc1-2769-4500-956d-48eae32526f5
Messenger
0
.0.0.0
CREATING
1.12.0
1.8.0
1.7.0
1.6.0

{ "instance" : { "uuid" : "5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7" , "name" : "test1" , "created_at" : "2021-05-29T11:54:35.000Z" , "max_run_duration" : 1440 , "max_inactivity_duration" : 0 , "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" , "hwprofile" : { "uuid" : "f34de94f-1e85-4d61-9b0d-c47968bc156c" , "name" : "Samsung Galaxy S8" , "form_factor" : "PHONE" , "cpu_count" : 4 , "ram_size" : 4096 , "data_disk_size" : 32768 , "source" : "genymotion" , "display_settings" : { "hw_navigation_keys" : false , "displays" : [ { "width" : 1440 , "height" : 2960 , "density" : 480 , "screen" : "1440 x 2960 dpi 480" } ] } }, "osimage" : { "uuid" : "f29482b4-10ba-4e89-83d3-b5919a34a484" , "name" : "Android 8.0 (Oreo)" , "image_version" : "2.17.0" , "android_version" : "8.0" , "api_version" : 26 , "architecture" : "x86" , "source" : "genymotion" , "is_beta" : false } } }, "exit_code" : 0 , "exit_code_desc" : "NO_ERROR" }


## List Instances
$ gmsaas instances list

Default output
JSON 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.

UUID NAME ADB SERIAL STATE ------------------------------------ ------------------ ------------ ------- e5771dc1-2769-4500-956d-48eae32526f5 Messenger 0 .0.0.0 ONLINE 1.12.0 1.8.0 1.7.0 1.5.2 1.5.1 1.5.0

{
"instances"
:
[
{
"uuid"
:
"5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7"
,
"name"
:
"test1"
,
"created_at"
:
"2021-05-29T11:54:35.000Z"
,
"max_run_duration"
:
1440
,
"max_inactivity_duration"
:
0
,
"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"
,
"display_settings"
:
{
"hw_navigation_keys"
:
false
,
"displays"
:
[
{
"width"
:
1440
,
"height"
:
2960
,
"density"
:
480
,
"screen"
:
"1440 x 2960 dpi 480"
}
]
}
},
"osimage"
:
{
"uuid"
:
"f29482b4-10ba-4e89-83d3-b5919a34a484"
,
"name"
:
"Android 8.0 (Oreo)"
,
"android_version"
:
"8.0"
,
"api_version"
:
26
,
"architecture"
:
"x86"
,
"source"
:
"genymotion"
,
"is_beta"
:
false
}
}
},
...
],
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

Connect an Instance to ADB

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

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

Default output JSON output

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

$ gmsaas instances adbconnect ab47b279-05ef-4496-9e45-bc6af0085122
localhost:40249
1.12.0
1.8.0
1.7.0
1.5.2
1.5.1
1.5.0

{ "instance" : { "uuid" : "099bd927-a0b9-4ff0-b4bc-d474175945b7" , "name" : "test3" , "created_at" : "2021-03-29T11:54:35.000Z" , "max_run_duration" : 1440 , "max_inactivity_duration" : 0 , "state" : "ONLINE" , "adbtunnel_state" : "CONNECTED" , "adb_serial" : "localhost:37007" , "adb_serial_port" : 37007 , "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" , "hwprofile" : { "uuid" : "f34de94f-1e85-4d61-9b0d-c47968bc156c" , "name" : "Samsung Galaxy S8" , "form_factor" : "PHONE" , "cpu_count" : 4 , "ram_size" : 4096 , "data_disk_size" : 32768 , "source" : "genymotion" , "display_settings" : { "hw_navigation_keys" : false , "displays" : [ { "width" : 1440 , "height" : 2960 , "density" : 480 , "screen" : "1440 x 2960 dpi 480" } ] } }, "osimage" : { "uuid" : "f29482b4-10ba-4e89-83d3-b5919a34a484" , "name" : "Android 8.0 (Oreo)" , "image_version" : "2.17.0" , "android_version" : "8.0" , "api_version" : 26 , "architecture" : "x86" , "source" : "genymotion" , "is_beta" : false } } }, "exit_code" : 0 , "exit_code_desc" : "NO_ERROR" }


## Save an Instance
Changes are not automatically saved. As a result, any modification to a virtual device has to be saved manually through this command.

Information
The instance will be stopped in order to be saved.
Information
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>

Default output
JSON output

$ gmsaas instances save 5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7 Instance 'test1' has been saved successfully.

{
"instance_uuid"
:
"5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7"
,
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

"Save As" an Instance

If you started a virtual device from an official recipe, you can save it as a custom recipe and custom image.

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

Default output JSON output

Instance
'test1'
has
been
saved
successfully.
Recipe
'MyRecipe'
and
Image
'MyImage'
have
been
created.

{ "instance_uuid" : "5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7 " , "recipe_name" : "MyRecipe" , "osimage_name" : "MyImage" , "exit_code" : 0 , "exit_code_desc" : "NO_ERROR" }


## 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.

Tip
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
JSON output

No output.

1.12.0 1.8.0 1.7.0 1.5.2 1.5.1 1.5.0

{
"instance"
:
{
"uuid"
:
"62e c330e-47d2-4a6b-939f-222318505329"
,
"name"
:
"test4"
,
"created_at"
:
"2021-02-29T11:54:35.000Z"
,
"max_run_duration"
:
1440
,
"max_inactivity_duration"
:
0
,
"state"
:
"DELETED"
,
"adbtunnel_state"
:
"DISCONNECTED"
,
"adb_serial"
:
"0.0.0.0"
,
"adb_serial_port"
:
0
,
"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"
,
"hwprofile"
:
{
"uuid"
:
"f34de94f-1e85-4d61-9b0d-c47968bc156c"
,
"name"
:
"Samsung Galaxy S8"
,
"form_factor"
:
"PHONE"
,
"cpu_count"
:
4
,
"ram_size"
:
4096
,
"data_disk_size"
:
32768
,
"source"
:
"genymotion"
,
"display_settings"
:
{
"hw_navigation_keys"
:
false
,
"displays"
:
[
{
"width"
:
1440
,
"height"
:
2960
,
"density"
:
480
,
"screen"
:
"1440 x 2960 dpi 480"
}
]
}
},
"osimage"
:
{
"uuid"
:
"f29482b4-10ba-4e89-83d3-b5919a34a484"
,
"name"
:
"Android 8.0 (Oreo)"
,
"image_version"
:
"2.17.0"
,
"android_version"
:
"8.0"
,
"api_version"
:
26
,
"architecture"
:
"x86"
,
"source"
:
"genymotion"
,
"is_beta"
:
false
}
}
},
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

List Instances (continued)

$ gmsaas instances list

Default output JSON output

UUID
NAME
ADB
SERIAL
STATE
------------------------------------
------------------
------------
-------
e5771dc1-2769-4500-956d-48eae32526f5
Messenger
0
.0.0.0
ONLINE
1.12.0
1.8.0
1.7.0
1.5.2
1.5.1
1.5.0

Connect an Instance to ADB (continued)

$ gmsaas instances adbconnect ab47b279-05ef-4496-9e45-bc6af0085122
localhost:40249

Default output JSON output

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

Tip 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

Save an Instance (continued)

$ gmsaas instances save <instance_uuid>

Default output JSON output

$ gmsaas instances save 5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7
Instance 'test1' has been saved successfully.

"Save As" an Instance (continued)

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

Default output JSON output

Instance
'test1'
has
been
saved
successfully.
Recipe
'MyRecipe'
and
Image
'MyImage'
have
been
created.

Stop an Instance (continued)

$ 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.

Tip 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 JSON output

No output.

62e c330e-47d2-4a6b-939f-222318505329

Display Instances (gmsaas portal)

$ gmsaas instances display [<instance_uuid>, ...]

Default output JSON output

"url"
:
"<hidden>"
,
"message"
:
"Generated URL copied in your clipboard, paste it in your web browser."
,
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"

Generated URL copied in your clipboard, paste it in your web browser.

Setting Up and Tearing Down ADB

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

gmsaas adb start
gmsaas adb stop

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 your tests: gmsaas adb start 5. Run your test suite. 6. Stop the ADB stack after tests complete: gmsaas adb stop 7. Una Authenticate 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 will start both ADB server and ADB Tunnel server.

$ gmsaas adb start '<path_to_gmadbtunneld>' and '<path_to_adb>' started successfully.

{
"issues"
:
[],
"exit_code"
:
0
,
"exit_code_desc"
:
"NO_ERROR"
}

Stop ADB

$ gmsaas adb stop

This will stop both ADB server and ADB Tunnel server.

$ gmsaas adb stop
'<path_to_gmadbtunneld>' and '<path_to_adb>' stopped successfully.

{ "issues" : [], "exit_code" : 0 , "exit_code_desc" : "NO_ERROR" } ```

Back to top