I’m trying to set up Jenkins with Android Emulator Plugin for testing automation. When Jenkins tries to install the apk the emulator can’t be found. However if I install the .apk through Eclipse everything works fine.
As Ant command I’m using installt
This is Jenkins output:
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:43944
[android] Emulator is ready for use (took 35 seconds)
[workspace] $ ant "-Dadb.device.arg=-s Froyo" -Dsdk.dir=/opt/android-sdk-linux -Dtarget=android-8 -Dtested.project.dir=../../Finder/workspace installt
Buildfile: /var/lib/jenkins/jobs/FinderTest/workspace/build.xml
-check-env:
[checkenv] Android SDK Tools Revision 20.0.3
[checkenv] Installed at /opt/android-sdk-linux
-setup:
[echo] Project Name: Finder
[gettype] Project Type: Test Application
-test-project-check:
-set-mode-check:
-set-debug-files:
install:
[echo] Installing /var/lib/jenkins/jobs/FinderTest/workspace/bin/Finder-debug.apk onto default emulator or device...
[exec] error: device not found
[exec] - waiting for device -
As you can see on the second line, the emulator is ready but at installation is not recognized.
You’re trying to install on an emulator with the serial number “Froyo”. This alone is odd, as the “-s” parameter is for device identifiers, rather than the AVD name. But generally you shouldn’t hardcode something like this anyway.
Remove the “adb.device.arg” parameter from your Ant build, and the app will be installed on the emulator started by Jenkins.