Genymotion Shell

Genymotion provides a shell to script the modification of sensor statuses.

Starting Genymotion Shell

To start Genymotion Shell, perform the action corresponding to your operating system.

Windows

Double-click in your application menu or desktop, or run this command in a command prompt.

macOS

Click from the Applications directory or run this command in a terminal:

/Applications/Genymotion Shell.app/Contents/MacOS/genyshell

Linux

In a terminal, run:

~/genymotion/genymotion-shell or /opt/genymotion/genymotion-shell

Interacting with Genymotion Shell

With the commands below, you can perform various basic actions related to the use of Genymotion Shell.

Interacting with virtual devices

To modify sensor statuses and values of a virtual device, Genymotion Shell provides commands grouped by category corresponding to the component of the virtual device they interact with. This section lists available commands of each category.

Devices

The devices command interacts or returns results about virtual devices themselves. Available subcommands are:

Example

Genymotion Shell > devices list

Available devices:

| Id | Select | Status | Type | IP Address | Name | |---|---|---|---|---|---| | 0 | | Off | virtual | 0.0.0.0 | Samsung Galaxy S8 | | 1 | | Off | virtual | 0.0.0.0 | Samsung Galaxy S9 |

Battery

The battery commands interact with the Battery widget. Available subcommands are:

Example

Genymotion Shell > battery getlevel Battery level: 97%

GPS

The gps command interacts with the GPS widget. Available subcommands are:

Example

Genymotion Shell > gps setstatus enabled GPS status set to: enabled Genymotion Shell > gps setlatitude 50 GPS Latitude set to: 50 Genymotion Shell > gps setlongitude 40 GPS Longitude set to: 40

Rotation

The rotation command interacts with the rotation feature.

Available subcommand is setangle <value> to set the rotation angle value of the virtual device. Value must be 0, 90, 180 or 270 degrees.

Example

Genymotion Shell > rotation setangle 180 Device angle for rotation set to: 180

Android

The android command interacts with the Identifiers widget. Available subcommands are:

Example

Genymotion Shell > android version Version: 8.1.0 Genymotion Shell > android getandroidid Android ID: e77d9eeb469a647b

Disk I/O

The diskio command interact with the Disk I/O widget. Available subcommands are:

Example

Genymotion Shell > diskio getreadratelimit Read byte rate is unlimited

Network

The network command interact with the Network widget. Available subcommands are:

Android 8.0 and higher

Example

Genymotion Shell > network getstatus wifi wifi interface is enabled Genymotion Shell > network setmobileprofile edge Mobile network profile set to edge Genymotion Shell > network setsignalstrength mobile moderate Signal strength for mobile set to moderate

Android 5.0 - 7.1

Phone

The phone command interact with the Phone widget. Available subcommands are:

Example

Genymotion Shell > phone baseband sms send 123456789 Hello!

Interacting with Genymotion

The genymotion command allows you to perform actions related to the Genymotion application via Genymotion Shell.

Available subcommands are:

Example

Genymotion Shell > genymotion capabilities {"accelerometer":true,"baseband":true,"battery":true,"camera":true,"deviceid":true,"diskio":true,"gps":true,

Using Genymotion Shell from a command prompt or script

You can connect to Genymotion Shell and interact with a virtual device from a command prompt or in a script.

Options below are specific to the command line interface:

Example

./genyshell -c "battery getlevel" Connection mode: local host Welcome to Genymotion Shell

Genymotion virtual device selected: Samsung Galaxy S8_1

Battery level: 100%