You are here: Tools > Gradle Plugin for Genymotion > Configuring the plugin

Configuring the plugin

To configure the Gradle plugin, you must declare the configuration properties, as shown below:

genymotion {
  config {
    genymotionPath = "/home/user/app/genymotion/"
    taskLaunch = "myCustomTask"

The 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 genymotion.config.taskLaunch property.

To configure the plugin:

  1. Open a genymotion.config block in your build.gradle file.
  2. 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.
  3. Define the Gradle task where Genymotion tasks will be injected (taskLaunch).
    In the example above, virtual devices will be ready before the runTest task 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:

genymotion {
  config {
    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 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 file by prefixing the config key with genymotion.

When committing your files, make sure you ignore the file.