Over a million developers have joined DZone.

Set Up Jenkins for Android Projects

DZone's Guide to

Set Up Jenkins for Android Projects

Learn how to set up CI for your mobile projects in a few easy steps.

Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

First we must install the Gradle plugin for Jenkins.


The we must install the Android emulator plugin for Jenkins.

Android emulator

We have to install Gradle on jenkins

wget https://services.gradle.org/distributions/gradle-2.5-bin.zipunzip gradle-2.5-bin.zipmvgradle-2.5 /var/lib/jenkins/tools/

Then we configure the gradle plugin

Gradle configuration

Next we install the android sdk

tar-xvf android-sdk_r24.3.3-linux.tgzmvandroid-sdk-linux /var/lib/jenkins/toolscd/var/lib/jenkins/tools/android-sdk-linux/./tools/androidupdate sdk --no-ui

Then we configure the android plugin

Screen Shot 2015-08-16 at 3.07.08 PM

Then we need to install the following libraries since we are provided with a 32 bit adb. (This works command for ubuntu)

sudoapt-get installlibc6-i386 lib32gcc1 libncurses5:i386 libstdc++6:i386 zlib1g:i386

Before proceeding it is wise to ignore from your revision system the local.properties file.

if you use git you should put it on .gitingore

On our new build plan we add the build environment.

Screen Shot 2015-08-16 at 4.45.16 PM

Then we add a Gradle command

Screen Shot 2015-08-16 at 4.46.13 PM

In case our build.gradle has a buildtoolsversion not available on the jenkins side your need to use the android binary inside the sdk to download the build tool version needed.
For example

./androidupdate sdk -u -a -t {build tools package number}

Our android plan is ready.

To sum up it is not as painful as we might think however extra care needs to be given considering the android sdk installation and the build tools.

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

jenkins ,ci ,android

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}