To configure the Gradle plugin, you must declare the configuration properties, as shown below:
genymotionPath = "/home/user/app/genymotion/"
taskLaunch = "myCustomTask"
taskLaunch property is optional. By default, if an Android plugin is detected, all defined virtual devices will be up and ready before the Android instrumentation tasks (connectedAndroidTest, etc.). If no Android plugin is detected, you must configure the behavior and therefore, define the
To configure the plugin:
- Open a
genymotion.configblock in your
- If you did not install Genymotion on the default path on Windows and Mac or if the Genymotion folder is not on your PATH environment variable, set the Genymotion installer path (
genymotionPath) to let the plugin run the GMTool binary.
- Define the Gradle task where Genymotion tasks will be injected (
In the example above, virtual devices will be ready before the
runTesttask is launched and will be closed and removed when finished.
Other properties that can be set are detailed in section Configuration properties.
By default, the plugin uses the current Genymotion configuration (for username, password, license, proxy, etc.) but you can set it using the Gradle plugin:
username = "myuser"
password = "password"
license = "mylicense"
However, good practice is not to set these data inside the
build.gradle file. Usernames and passwords must not be published on your versioning repository. Instead, you must configure it from your
local.properties file or create it if it does not exist yet.
This file is located in the project root folder.
You can set all configuration parameters from the
local.properties file by prefixing the config key with
When committing your files, make sure you ignore the
This section lists all parameters that can be defined for the
genymotionPath = GENYMOTION_INSTALLER_PATH
sets the Genymotion installer path.
fromFile = CONFIG.properties
retrieves a whole configuration from a file. The file content gets the priority over the
username = USERNAME
sets the user to authenticate.
password = PASSWORD
sets the password to associate with the username.
licenseServer = true|false
activates or deactivates the use of a license server.
licenseServerAddress = SERVER_ADDRESS
sets the license server address.
license = LICENSE_KEY
registers a license key or renews Genymotion activation.
statistics = true|false
allows or prevents Genymotion to collect usage statistics.
proxy = true|false
activates or deactivates the use of a proxy.
proxyAddress = PROXY_ADDRESSsets the proxy address.
proxyPort = PROXY_PORT
sets the proxy port.
proxyAuth = true|false
activates or deactivates proxy authentication.
proxyUsername = PROXY_USERNAME
sets the username to be used for proxy authentication.
proxyPassword = PROXY_PASSWORD
sets the password to be used for proxy authentication.
virtualDevicePath = VIRTUAL_DEVICE_PATH
sets the path to the virtual device directory, where configurations are stored.
androidSdkPath = SDK_PATH
sets the path to the custom Android SDK directory.
This is where a specific ADB tool is retrieved. If not specified, Genymotion ADB tool is used.
useCustomSdk = true|false
activates or deactivates the use of the custom Android SDK.
screenCapturePath = SCREEN_CAPTURE_PATH
sets the path to the screen capture directory.
taskLaunch = "TASK"
defines the task that depends on the Genymotion launch task.
automaticLaunch = true|false
enables or disables injection of Genymotion tasks.
processTimeout = TIMEOUT_IN_MILLISECONDS
sets the timeout in seconds for all processes launched in command line.
verbose = true|false
gives a complete description of the command to help diagnose errors.
abortOnError = true|false
aborts or continues the task execution if a GMTool error occurs.