Skip to content

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

Recipes list formatted as a table.

Example

$ gmsaas recipes list
UUID                                  NAME                               ANDROID    SCREEN               SOURCE
------------------------------------  ---------------------------------  ---------  -------------------  ----------
b1e51193-4db8-43f7-b7cd-ae35eebb6bca  Custom Phone                       4.4.4      768 x 1280 dpi 320   genymotion
5e4c60b3-327b-4fb4-98e2-4f996900e145  Custom Tablet                      4.4.4      1536 x 2048 dpi 320  genymotion
42b60b69-bd60-4c3d-912c-4073d854573d  Google Nexus 10                    4.4.4      2560 x 1600 dpi 320  genymotion
31f96174-9148-4bd3-84dd-0819681936bf  Google Nexus 4                     4.4.4      768 x 1280 dpi 320   genymotion
b4f164b3-277e-4efe-9fcd-38f6d847ddd7  Google Nexus 5                     4.4.4      1080 x 1920 dpi 480  genymotion
e38a1ec9-5fbf-481c-9103-d1782ea9f1d7  Google Nexus 7                     4.4.4      800 x 1280 dpi 213   genymotion
$ gmsaas --format json recipes list
{
    "recipes": [
        {
            "uuid": "b1e51193-4db8-43f7-b7cd-ae35eebb6bca",
            "name": "Custom Phone",
            "android_version": "4.4.4",
            "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"
}

Start an instance

Caution

Frontend inactivity (time out) will not apply to instances launched with this command.
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.

Warning

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.

<instance_uuid> is printed.

Example

$ gmsaas instances start b9cf7b2c-4d11-4777-97c7-29d3b5c68d59 test
62ec330e-47d2-4a6b-939f-122718505329
$ gmsaas --format json instances start b9cf7b2c-4d11-4777-97c7-29d3b5c68d59 test
{
    "instance": {
        "uuid": "62ec330e-47d2-4a6b-939f-122718505329",
        "name": "test",
        "created_at": "2021-05-29T11:54:35.000Z",
        "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"
        }
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances start b9cf7b2c-4d11-4777-97c7-29d3b5c68d59 test
{
    "instance": {
        "uuid": "62ec330e-47d2-4a6b-939f-122718505329",
        "name": "test",
        "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"
        }
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances start b9cf7b2c-4d11-4777-97c7-29d3b5c68d59 test
{
    "instance": {
        "uuid": "62ec330e-47d2-4a6b-939f-122718505329",
        "name": "test",
        "state": "ONLINE",
        "adbtunnel_state": "DISCONNECTED",
        "adb_serial": "0.0.0.0",
        "adb_serial_port": 0,
        "recipe": {
            "uuid": "b9cf7b2c-4d11-4777-97c7-29d3b5c68d59"
        }
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances start b9cf7b2c-4d11-4777-97c7-29d3b5c68d59 test
{
    "instance": {
        "uuid": "62ec330e-47d2-4a6b-939f-122718505329",
        "name": "test",
        "state": "ONLINE",
        "adbtunnel_state": "DISCONNECTED",
        "adb_serial": "0.0.0.0",
        "adb_serial_port": 0
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}

Get instance information

1.6.0

gmsaas instances get <instance_uuid>

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

Example

$ gmsaas instances get e5771dc1-2769-4500-956d-48eae32526f5 
UUID                                  NAME                ADB SERIAL    STATE
------------------------------------  ------------------  ------------  --------
e5771dc1-2769-4500-956d-48eae32526f5  Facebook Messenger  0.0.0.0       CREATING
$ gmsaas --format json instances get 5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7
{
    "instance": {
        "uuid": "5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7",
        "name": "test1",
        "created_at": "2021-05-29T11:54:35.000Z",
        "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"
}
$ 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

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.

Example

$ gmsaas instances list
UUID                                  NAME                ADB SERIAL    STATE
------------------------------------  ------------------  ------------  -------
e5771dc1-2769-4500-956d-48eae32526f5  Facebook Messenger  0.0.0.0       ONLINE
$ gmsaas --format json instances list
{
    "instances": [
        {
            "uuid": "5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7",
            "name": "test1",
            "created_at": "2021-05-29T11:54:35.000Z",
            "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"
            }
        },
        {
            "uuid": "ab47b279-05ef-4896-9e45-bc6af0085022",
            "name": "test2",
            "created_at": "2021-04-29T11:54:35.000Z",
            "state": "ONLINE",
            "adbtunnel_state": "CONNECTED",
            "adb_serial": "localhost:33455",
            "adb_serial_port": 33455,
            "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"
            }
        },
        {
            "uuid": "099bd927-a0b9-4ff0-b4bc-d474175945b7",
            "name": "test3",
            "created_at": "2021-03-29T11:54:35.000Z",
            "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"
            }
        },
        ...
    ],
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances list
{
    "instances": [
        {
            "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"
            }
        },
        {
            "uuid": "ab47b279-05ef-4896-9e45-bc6af0085022",
            "name": "test2",
            "state": "ONLINE",
            "adbtunnel_state": "CONNECTED",
            "adb_serial": "localhost:33455",
            "adb_serial_port": 33455,
            "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"
            }
        },
        {
            "uuid": "099bd927-a0b9-4ff0-b4bc-d474175945b7",
            "name": "test3",
            "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"
            }
        },
        ...
    ],
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances list
{
    "instances": [
        {
            "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"
            }
        },
        {
            "uuid": "ab47b279-05ef-4896-9e45-bc6af0085022",
            "name": "test2",
            "state": "ONLINE",
            "adbtunnel_state": "CONNECTED",
            "adb_serial": "localhost:33455",
            "adb_serial_port": 33455,
            "recipe": {
                "uuid": "b9cf7b2c-4d11-4777-97c7-29d3b5c68d59"
            }
        },
        {
            "uuid": "099bd927-a0b9-4ff0-b4bc-d474175945b7",
            "name": "test3",
            "state": "ONLINE",
            "adbtunnel_state": "DISCONNECTED",
            "adb_serial": "0.0.0.0",
            "adb_serial_port": 0,
            "recipe": {
                "uuid": "b9cf7b2c-4d11-4777-97c7-29d3b5c68d59"
            }
        },
        ...
    ],
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances list
{
    "instances": [
        {
            "uuid": "5a4d74e6-e6b2-4dd3-8d6c-1eea275b5ea7",
            "name": "test1",
            "state": "ONLINE",
            "adbtunnel_state": "CONNECTED",
            "adb_serial": "localhost:39745",
            "adb_serial_port": 39745
        },
        {
            "uuid": "ab47b279-05ef-4896-9e45-bc6af0085022",
            "name": "test2",
            "state": "ONLINE",
            "adbtunnel_state": "CONNECTED",
            "adb_serial": "localhost:33455",
            "adb_serial_port": 33455
        },
        {
            "uuid": "099bd927-a0b9-4ff0-b4bc-d474175945b7",
            "name": "test3",
            "state": "ONLINE",
            "adbtunnel_state": "DISCONNECTED",
            "adb_serial": "0.0.0.0",
            "adb_serial_port": 0
        },
        ...
    ],
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}

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

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

1.5.0

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

Example

$ gmsaas instances adbconnect ab47b279-05ef-4496-9e45-bc6af0085122
localhost:40249
$ gmsaas --format json instances adbconnect 099bd927-a0b9-4ff0-b4bc-d474175945b7
{
    "instance": {
        "uuid": "099bd927-a0b9-4ff0-b4bc-d474175945b7",
        "name": "test3",
        "created_at": "2021-03-29T11:54:35.000Z",
        "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"
        }
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances adbconnect 099bd927-a0b9-4ff0-b4bc-d474175945b7
{
    "instance": {
        "uuid": "099bd927-a0b9-4ff0-b4bc-d474175945b7",
        "name": "test3",
        "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"
        }
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances adbconnect 099bd927-a0b9-4ff0-b4bc-d474175945b7
{
    "instance": {
        "uuid": "099bd927-a0b9-4ff0-b4bc-d474175945b7",
        "name": "test3",
        "state": "ONLINE",
        "adbtunnel_state": "CONNECTED",
        "adb_serial": "localhost:37007",
        "adb_serial_port": 37007,
        "recipe": {
            "uuid": "b9cf7b2c-4d11-4777-97c7-29d3b5c68d59"
        }
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances adbconnect 099bd927-a0b9-4ff0-b4bc-d474175945b7
{
    "instance": {
        "uuid": "099bd927-a0b9-4ff0-b4bc-d474175945b7",
        "name": "test3",
        "state": "ONLINE",
        "adbtunnel_state": "CONNECTED",
        "adb_serial": "localhost:37007",
        "adb_serial_port": 37007
    },
    "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

No output.

$ gmsaas --format json instances stop 62ec330e-47d2-4a6b-939f-222318505329
{
    "instance": {
        "uuid": "62ec330e-47d2-4a6b-939f-222318505329",
        "name": "test4",
        "created_at": "2021-02-29T11:54:35.000Z",
        "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"
        }
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances stop 62ec330e-47d2-4a6b-939f-222318505329
{
    "instance": {
        "uuid": "62ec330e-47d2-4a6b-939f-222318505329",
        "name": "test4",
        "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"
        }
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances stop 62ec330e-47d2-4a6b-939f-222318505329
{
    "instance": {
        "uuid": "62ec330e-47d2-4a6b-939f-222318505329",
        "name": "test4",
        "state": "DELETED",
        "adbtunnel_state": "DISCONNECTED",
        "adb_serial": "0.0.0.0",
        "adb_serial_port": 0,
        "recipe": {
            "uuid": "b9cf7b2c-4d11-4777-97c7-29d3b5c68d59"
        }
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
$ gmsaas --format json instances stop 62ec330e-47d2-4a6b-939f-222318505329
{
    "instance": {
        "uuid": "62ec330e-47d2-4a6b-939f-222318505329",
        "name": "test4",
        "state": "DELETED",
        "adbtunnel_state": "DISCONNECTED",
        "adb_serial": "0.0.0.0",
        "adb_serial_port": 0
    },
    "exit_code": 0,
    "exit_code_desc": "NO_ERROR"
}
Back to top