Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated some stuff for release 3.0.

Wiki Markup

Automates many Android development tasks including SDK installation, build file generation, emulator creation and launch, APK (un)installation, monkey testing and analysis...

See also: Android Lint Plugin.
See also: Google Play Android Publisher Plugin.


Table of Contents

Table of Contents


This plugin lets you automate a number of Android-related tasks during a build:




Jenkins version 12.609.332 or newer is required.



For convenience, the plugin places a number of variables into the build environment relating to the emulator in use:

Variable name

Example value




Identifier for connecting to this AVD, e.g. adb -s localhost:34564 shell



Identifier for connecting to this AVD, e.g. adb -s localhost:34564 shell



Port used by ADB to communicate with the AVD (random for each build)



Port used to access the AVD's telnet user interface (random for each build)



Name of the AVD running for the build



Locale of the AVD



OS version of the running AVD



Screen density in dpi of the AVD



Screen resolution, named or dimension, of the AVD



Skin being used by the AVD, e.g. WQVGA432 or 480x800



Port that the AVD server for this build is running on (random for each build)



Temporary file to which logcat output is written during the build (random for each build)



The path to the Android SDK being used for this build (optional)



The path to the Android SDK being used for this build (optional)

Using the emulator

Now that you have an Android emulator running, you'll probably want to install one or more Android applications (APKs) and start running some tests.


titleView known issues...

Pipeline not yet supported

This plugin is currently still only compatible with Freestyle jobs — Pipeline support is planned!

Emulator v2

The new-and-improved emulator engine — first released as part of SDK Tools 25 (and Android Studio 2.0) — unfortunately does not work with this plugin at the moment (April 2016).This plugin depends on several features that were removed in the new emulator engine (e.g. Android bug #205204), and therefore the plugin ensures that the original, version 1 engine is usedis supported as of version 3.0 of this plugin.

However, the Quick Boot feature (formerly known as snapshots) is currently not supported, as the command line tools do not appear to support this.

Android SDK Tools

Due to a regression in SDK Tools r12 and r13 (see Android bug #18444), running any builds with the "Use emulator snapshots" option enabled (which is the default), would likely fail to load in the state you expect. For example the emulator may not be ready for use, and the screen may not be unlocked.

To avoid this, either keep using r11 or earlier, or update to r14 or newer. However, if you update, you will have to manually delete all existing snapshot images and allow this plugin to re-create them.
See the Known Issues page on the Android Tools site for more information.

Similarly, snapshot support does not fully function for Android 4.0 until SDK Tools r15. An initial snapshot can be created, but subsequently loading from that snapshot will crash the emulator immediately. Earlier Android versions are not affected, i.e. you can still use snapshots with Android 3.2 and earlier. Upgrading to SDK Tools r15+ should fix this.

As a workaround, you can also uncheck "Use emulator snapshots" in any jobs where you are seeing problems.

Running in a Windows service as "Local System"

New AVDs cannot be generated and run if Jenkins is running as a Windows service, using the "Local System" account (see JENKINS-7355).

  • Workaround: configure the Jenkins service to "run as" a real user

Emulator UI doesn't appear when running on Windows 7

If running Jenkins as a service on Windows 7 or newer, you may find that while the plugin can start an emulator, its user interface may not appear, even if configured to do so.
This is due to something called Session 0 Isolation, which prevents services from starting UIs for security reasons.

If you really need to see the emulator UI, you can either run Jenkins not as a service, or add a slave node to Jenkins (e.g. launch slave via JNLP on the same machine) which will bypass this isolation.

Unexpected timeouts or hanging during build

AVDs can, on occasion, time-out unexpectedly or stop responding during a build, e.g. when trying to install an APK (see JENKINS-7354).

  • This is generally caused by bugs in the ADB process. It can be prone to hanging or crashing. Over time, more safeguards have been added to the plugin, including timing-out after a while and isolating ADB instances, so this shouldn't happen too often.

This should also be more stable with version 3.0 of this plugin, which allows the new emulator engine to be used.

AVDs may not shut down fully at the end of a build

Sometimes the emulator process does not shut down fully at the end of a build (requiring a kill -9 on Linux); the plugin sends a console command to terminate the emulator and the UI window closes, but the actual emulator process does not die.

  • This issue will be fixed once JENKINS-11995 is implemented.
  • If your slave is running Linux, you may be running into Android issue #17294
    In this case, there is a workaround assuming your build doesn't need to use the emulator's audio input:
    • Add a custom hardware property called "hw.audioInput" with the value "no"

Potential upcoming features

Version history

Version 3.0 (December 4, 2017)

Many thanks to Michael Musenbrock for doing most of the heavy lifting on this release.

  • Added support for Android Emulator 2.0 (JENKINS-40178, JENKINS-43215, JENKINS-44490)

    • The QEMU2 engine will be used automatically, and should be faster and more stable

    • Older SDK Tools will be automatically upgraded to a modern version as appropriate

    • Fixed creation of non-default ABI images with SDK Tools < 25.3 (JENKINS-32737)

    • Thanks to Michael Musenbrock

  • Fixed to select the configured emulator executable when listing snapshots (JENKINS-34678)

  • Updated to non-deprecated artifact archiving mechanism (JENKINS-26941)

  • Added configuration-time check for application ID in the APK uninstall step (PR #53)

  • Fixed Findbugs warnings, reduced other warnings, and removed deprecated code usages (JENKINS-45456)

    • Thanks to Michael Musenbrock

  • Added a Jenkinsfile for

  • Updated minimum Jenkins version to 2.32

Version 2.15 (May 23, 2016)

  • Ensure that newer emulators aren't left running when a build completes (JENKINS-35004)
    • This is required as SDK Tools 25.1.6 introduced a breaking change to the emulator console interface

Version 2.14.1 (April 20, 2016)

  • Fix crash when using named emulators (JENKINS-34152)
  • Updated names and inline help for build steps that create project build files or install prerequisites, to mention that these only work for the deprecated Ant build system

Version 2.14 (April 8, 2016)

  • Fixed severe reliability issues when multiple emulators were running at the same time
  • Improved emulator startup detection to be more reliable
    • Thanks to Andy Piper
  • Prevented emulators from using the new QEMU2 engine, which is missing required features (e.g. Android bugs #202762, #202853, #205202, #205204, #205272)
  • Ensured that the screen density is configured when creating an emulator
  • Added the ability to use the dedicated screen unlock command on Android 6+ (JENKINS-30849)
  • Implemented master-agent access control
  • When auto-installing the Android SDK, version 24.4.1 is now used
  • Added support for newer screen densities that are in use (400, 420, 560dpi)
  • Added support for Android 6.0