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

Using the plugin

To access all features of the Gradle plugin, you must declare the virtual devices you want to create and start prior to running tests, as shown below:

genymotion {
  devices {
    nexus5 {
      template "Google Nexus 5 - 4.4.4 - API 19 - 1080x1920"

To declare a virtual device:

  1. Open a genymotion.devices block in your build.gradle file.
  2. Add a virtual device name block.
    By adding this block to your build.gradle file, you ask to create and then start a Nexus 5 prior to running the tests.
  3. Define the virtual device configuration. Here the virtual device is defined by a template ("Google Nexus 5 - 4.4.4 - API 19 - 1080x1920").

The virtual device will be started and accessible via adb. The Android Gradle plugin will then run all the instrumentation tests on it.

By default, all virtual devices are created prior to the tests and then deleted on the fly.