GMTool

GMTool is a command line tool allowing you to use every command of Genymotion and virtual devices, in order to automate series of actions. It can be started by running gmtool from a command prompt.

This section lists and explains all commands available in GMTool, as well as error messages that can be returned.

Location

gmtool command line tool is located in the following path:

Windows

C:\Program Files\Genymobile\Genymotion\

macOS

/Applications/Genymotion.app/Contents/MacOS/

Linux

$HOME/genymotion/

or

/opt/genymotion/

General commands and options

The version command returns Genymotion Desktop version and revision number.

Global options are:

gmtool license

The license command group allows you to perform actions related to the Genymotion license. Commands available within this group are:

Registers the license key

0123456789

and authenticates the user with the email and password provided by the config command.

gmtool config

The config command group allows you to define Genymotion Desktop settings. Options available within this group are:

gmtool admin

The admin command group allows you to administrate virtual devices.

Basic commands

Start the virtual device named "My Phone":

List all the running virtual devices:

Advanced commands

> Warning: This command is deprecated. Please use hwprofiles and osimages commands instead.

Examples

Create a device named "My Samsung Phone" with the Samsung Galaxy S10 profile, Android 11.0 and default settings:

Create a device named "My Custom Phone" with the Custom Phone profile, Android 11.0, 1440x2560 display resolution, 560dpi, 4 CPUs and 4GB in RAM:

Change the "My Custom Phone" device display resolution to 728x1024 and 240dpi (hdpi):

gmtool device

The device command group allows you to directly interact with a virtual device.

Options

Commands

Commands available in the device command group are:

Example

Error messages

The table below explains error codes returned by GMTool:

| Code | Meaning | |---|---| | 1 | The command does not exist. | | 2 | A wrong parameter value has been entered. | | 3 | The command has failed. | | 4 | The virtualization engine does not respond. | | 5 | The specified virtual device could not be found. | | 6 | Unable to sign in. | | 7 | Unable to register the license key. | | 8 | Unable to activate the license. | | 9 | The license has not been activated. | | 10 | The license key is invalid. | | 11 | The command has missing arguments. | | 12 | Unable to stop the virtual device. | | 13 | Unable to start the virtual device. | | 14 | This command can only run with Indie and Business licenses. |

Autocompletion

To be more productive with GMTool, you can install a completion script for your shell. We provide completion scripts for Bash and Zsh shells.

In this section, we explain how to install those scripts and we refer to the directory containing the Genymotion Desktop installer as {GENYMOTION_DIR}, the directory containing the GMTool binary as {GMTOOL_DIR} and the directory containing the completion script as {COMPLETION_DIR}:

Linux

macOS

Requirements

To take advantage of shell completion, add gmsaas binary path, {GMTOOL_DIR}, to $PATH. If you use VirtualBox hypervisor, you will also need to add your VirtualBox installation directory to $PATH.

Installing the Bash completion script

To install the Bash completion script, add this line at the end of your ~/.bash_profile file:

.{COMPLETION_DIR}/bash/gmtool.bash

Completion works with Bash 3.2 or later, but we recommend using at least version 4.0, especially if you work with file names containing spaces.

Installing the Zsh completion script

To install the Zsh completion script, open your ~/.zshrc and add this line before the call to compinit:

fpath=({COMPLETION_DIR}/zsh $fpath)