"error: device not found" for AVD Android 5.1 - android

I'm trying to install an .apk to AVD but the process just hangs with message - waiting for device -.
Here's how I'm starting the emulator itself and connecting to it:
$ /opt/android-sdk-linux/tools/emulator-arm -no-boot-anim -ports 5851,5852 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_android-22_armeabi-v7a_myapp -no-snapshot-load -no-snapshot-save -no-window -force-32bit -noaudio -gpu off
Failed to Initialize backend EGL display
$ /opt/android-sdk-linux/platform-tools/adb connect emulator-5851
[android] Waiting for emulator to finish booting...
$ /opt/android-sdk-linux/platform-tools/adb -s emulator-5851 shell getprop init.svc.bootanim
error: device offline
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:5851
$ /opt/android-sdk-linux/platform-tools/adb -s emulator-5851 shell getprop init.svc.bootanim
error: device offline
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:5851
$ /opt/android-sdk-linux/platform-tools/adb -s emulator-5851 shell getprop init.svc.bootanim
$ /opt/android-sdk-linux/platform-tools/adb -s emulator-5851 logcat -v time
[android] Attempting to unlock emulator screen
$ /opt/android-sdk-linux/platform-tools/adb -s emulator-5851 shell input keyevent 82
$ /opt/android-sdk-linux/platform-tools/adb -s emulator-5851 shell input keyevent 4
[android] Emulator is ready for use (took 47 seconds)
/opt/android-sdk-linux/platform-tools/adb connect emulator-5851
$ /opt/android-sdk-linux/platform-tools/adb -s emulator-5584 install -r myapp-debug-unaligned.apk
error: device not found
- waiting for device -
When I'm trying to run AVD for older android version, it works fine.

Related

Android Emulator is not started through Jenkins

I am trying to set up my mobile automation pack in Jenkins. As a first step, when I try to launch a emulator using Jenkins Android Emulator plugin, I am getting below error
Job Config
Android SDK details
Below is the error
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe start-server
[android] Snapshots are enabled, but cannot be used as they are not supported by the current SDK Tools
[android] Starting Android emulator
[android] Erasing existing emulator data...
$ C:\Users\Divakar\AppData\Local\Android\sdk/emulator/emulator.exe -ports 5764,5765 -report-console tcp:5850,max=60 -avd Pixel_2_Pie_9.0 -wipe-data -no-window
Failed to open /qemu.conf, err: 2
HAX is working and emulator runs in fast virt mode.
dsound: Could not set cooperative level for window 0000000000000000
dsound: Reason: An invalid parameter was passed to the returning function
audio: Could not init `dsound' audio driver
emulator: WARNING: Requested adb port (5765) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details.
[android] Emulator reported that the console is available on port 5,764
[android] Waiting for emulator to finish booting...
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5764 wait-for-device shell getprop dev.bootcomplete
ERROR: Timeout after 90000 milliseconds
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5764 wait-for-device shell getprop dev.bootcomplete
emulator: INFO: boot completed
emulator: Increasing screen off timeout, logcat buffer size to 2M.
emulator: Revoking microphone permissions for Google App.
ERROR: Timeout after 90000 milliseconds
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5764 wait-for-device shell getprop dev.bootcomplete
ERROR: Timeout after 90000 milliseconds
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5764 wait-for-device shell getprop dev.bootcomplete
ERROR: Timeout after 90000 milliseconds
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5764 wait-for-device shell getprop dev.bootcomplete
ERROR: Timeout after 90000 milliseconds
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5764 wait-for-device shell getprop dev.bootcomplete
ERROR: Timeout after 90000 milliseconds
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5764 wait-for-device shell getprop dev.bootcomplete
ERROR: Timeout after 90000 milliseconds
[android] Timed-out after waiting 720 seconds for emulator
[android] Stopping Android emulator
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe kill-server
emulator: Saving state on exit with session uptime 730379 ms
Finished: NOT_BUILT
After reducing the emulator RAM to 768MB, I can rid off the above issue. However I cant see any devices connected in adb devices command. If you see the below log, it started and immediately stopped.
Building in workspace C:\Program Files\Jenkins\Jenkins.jenkins\workspace\AVD_Manager_Start_Emulator
[android] Failed to create file or directory: C:\WINDOWS\system32\config\systemprofile\.android
[android] Using Android SDK: C:\Users\Divakar\AppData\Local\Android\sdk
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe start-server
* daemon not running; starting now at tcp:5813
* daemon started successfully
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe start-server
[android] Snapshots are enabled, but cannot be used as they are not supported by the current SDK Tools
[android] Starting Android emulator
[android] Erasing existing emulator data...
$ C:\Users\Divakar\AppData\Local\Android\sdk/emulator/emulator.exe -ports 5754,5755 -report-console tcp:5838,max=60 -avd Pixel_2_Pie_9.0 -wipe-data -no-window
Failed to open /qemu.conf, err: 2
HAX is working and emulator runs in fast virt mode.
dsound: Could not set cooperative level for window 0000000000000000
dsound: Reason: An invalid parameter was passed to the returning function
audio: Could not init `dsound' audio driver
emulator: WARNING: Requested adb port (5755) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details.
[android] Emulator reported that the console is available on port 5,754
[android] Waiting for emulator to finish booting...
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is ''
emulator: INFO: boot completed
emulator: Increasing screen off timeout, logcat buffer size to 2M.
emulator: Revoking microphone permissions for Google App.
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 wait-for-device shell getprop dev.bootcomplete
[android] Emulator reported that the startup process is '1'
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe -s emulator-5754 shell logcat -v time
[android] Emulator is ready for use (took 283 seconds)
[AVD_Manager_Start_Emulator] $ cmd /c call C:\WINDOWS\TEMP\jenkins8495526174755772173.bat
C:\Program Files\Jenkins\Jenkins.jenkins\workspace\AVD_Manager_Start_Emulator>exit 0
[android] Stopping Android emulator
emulator: Saving state on exit with session uptime 257552 ms
[android] Archiving emulator log
$ C:\Users\Divakar\AppData\Local\Android\sdk/platform-tools/adb.exe kill-server
Finished: SUCCESS
The issue has been resolved. Please find the steps that I have followed
Uninstall Jenkins
Install war file
Thats all

jenkins Emulator occasionally hangs indefinitely on startup

Problem: when I try to build an android project on Jenkins, emulator occasionally hangs indefinitely on startup and the job finished: NOT_BUILT.
I have Jenkins slaves running on Debian EC2 instances - not using any emulator snapshots, every run is fresh with a clean workspace, so I haven't been able to figure out the difference as to why sometimes they are starting correctly and more often not.
In "Common emulator options", I checked the option: 'Reset emulator state at start-up'.
Jenkins version: 1.642
Android Emulator Plugin: 2.13.1
...
[android] Using Android SDK: /var/lib/jenkins/tools/android-sdk
[android] Creating Android AVD: /var/lib/jenkins/.android/avd/hudson_it-IT_160_HVGA_android-22_armeabi-v7a.avd
[android] /var/lib/jenkins/tools/android-sdk/tools/android create avd -f -a -s HVGA -n hudson_it-IT_160_HVGA_android-22_armeabi-v7a -t android-22 --abi armeabi-v7a
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb start-server
* daemon not running. starting it now on port 6345 *
* daemon started successfully *
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb start-server
[android] Starting Android emulator
$ /var/lib/jenkins/tools/android-sdk/tools/emulator -ports 6343,6344 -prop persist.sys.language=it -prop persist.sys.country=IT -avd hudson_it-IT_160_HVGA_android-22_armeabi-v7a -no-snapshot-load -no-snapshot-save -wipe-data -no-window
resize2fs 1.42.13 (17-May-2015)
The filesystem is already 140800 (4k) blocks long. Nothing to do!
emulator: WARNING: Increasing RAM size to 1GB
Creating filesystem with parameters:
Size: 576716800
Block size: 4096
Blocks per group: 32768
Inodes per group: 7040
Inode size: 256
Journal blocks: 2200
Label:
Blocks: 140800
Block groups: 5
Reserved block group size: 39
Created filesystem with 11/35200 inodes and 4536/140800 blocks
Creating filesystem with parameters:
Size: 69206016
Block size: 4096
Blocks per group: 32768
Inodes per group: 4224
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 16896
Block groups: 1
Reserved block group size: 7
Created filesystem with 11/4224 inodes and 1302/16896 blocks
emulator: warning: opening audio output failed
emulator: UpdateChecker: skipped version check
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
connected to localhost:6344
[android] Waiting for emulator to finish booting...
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:6344 shell getprop init.svc.bootanim
error: device offline
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:6344
[android] Timed-out after waiting 720 seconds for emulator
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:6344
[android] Stopping Android emulator
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb kill-server
Finished: NOT_BUILT
Can Someone help me? Where and what is the problem?
Thank to all.

Jenkins unable to start emulator

I am trying to run the emulator on the Jenkins server.
But I keep getting this error that Jenkins is unable to start the emulator becoz of the error below until it times out:
[android] Waiting 10 seconds before starting emulator...
$ /opt/android-sdk-linux/platform-tools/adb start-server
* daemon not running. starting it now on port 9666 *
* daemon started successfully *
$ /opt/android-sdk-linux/platform-tools/adb start-server
[android] Starting Android emulator
$ /opt/android-sdk-linux/tools/emulator64-arm -ports 9664,9665 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_320_HVGA_android-19_armeabi-v7a -no-snapshot-load -no-snapshot-save -no-window -no-audio -gpu off
resize2fs 1.42.13 (17-May-2015)
The filesystem is already 51200 (4k) blocks long. Nothing to do!
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:9665
unable to connect to localhost:9665: Connection refused
[android] Waiting for emulator to finish booting...
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:9665 shell getprop init.svc.bootanim
error: device 'localhost:9665' not found
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:9665
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:9665 shell getprop init.svc.bootanim
error: device 'localhost:9665' not found
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:9665
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:9665 shell getprop init.svc.bootanim
error: device 'localhost:9665' not found
$ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:9665
error: no such device 'localhost:9665'
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:9665
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:9665 shell getprop init.svc.bootanim
error: device 'localhost:9665' not found
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:9665
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:9665 shell getprop init.svc.bootanim
error: device 'localhost:9665' not found
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:9665
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:9665 shell getprop init.svc.bootanim
error: device 'localhost:9665' not found
$ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:9665
error: no such device 'localhost:9665'
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:9665
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:9665 shell getprop init.svc.bootanim
error: device 'localhost:9665' not found
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:9665
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:9665 shell getprop init.svc.bootanim
error: device 'localhost:9665' not found
$ /opt/android-sdk-linux/platform-tools/adb connect localhost:9665
$ /opt/android-sdk-linux/platform-tools/adb -s localhost:9665 shell getprop init.svc.bootanim
error: device 'localhost:9665' not found
What should I do to get over this darn issue?
I had the same issue and it turned out that adb was crashing. In my case the cause for the crash was a permission error. Try deleting the file /tmp/adb.log before running the job. Please see this thread for more information: Is it possible to fake a specific path for a process?
You could also add the -verbose option to the emulator to see more output that might help.

Android emulator plugin, launcher icon is not found

I am using Android emulator plugin with jenkins. Along with the android application, I also have a java project for uiautomator which is the part of build modules in main pom.
The maven goal is : mvn install
The uiautomator test is failing at the point where it is trying to assert the presence of application launch icon from "Apps" screen.
Do I have to install the application apk or does the plugin does it automatically as described in the plugin documentation(My plugin version is 2.10 and jennkins version is 1.531)
How do i know that the application is installed in the emulator.
The emulator is started without any problem.
The following is the part of the jenkins log:
[android] Starting Android emulator $ /var/lib/jenkins/tools/android-sdk/tools/emulator -no-boot-anim -ports 35965,56985 -prop persist.sys.language=en -prop persist.sys.country=US
-avd hudson_en-US_120_800x1280_android-18_armeabi-v7a -no-snapshot-load -no-snapshot-save -no-window
* daemon not running. starting it now on port 42120 *
* daemon started successfully *
Failed to Initialize backend EGL display
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985 [android] Waiting for emulator to finish booting... $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell getprop dev.bootcomplete error: device offline $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell getprop dev.bootcomplete error: device offline $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell getprop dev.bootcomplete error: device offline $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:56985 $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell getprop dev.bootcomplete $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell getprop dev.bootcomplete $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell getprop dev.bootcomplete $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb disconnect localhost:56985 $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell getprop dev.bootcomplete $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell getprop dev.bootcomplete $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell getprop dev.bootcomplete $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 logcat -v time
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985 [android] Attempting to unlock emulator screen $ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell input keyevent 82
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s localhost:56985 shell input keyevent 4
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb connect localhost:56985 [android] Emulator is ready for use (took 97 seconds)
Do I have to install the application apk or does the plugin does it automatically as described in the plugin documentation
The documentation does not say that your APK will be automatically installed.
But the plugin does provide a build step which will do this for you, if you provide the path to an APK file:
Under the "Build" section of your job configuration, select "Add build step" and choose "Install Android package".
In the "APK file" field that appears, enter the filename of the APK you wish to install. When a build runs, the APK will be automatically installed after the emulator has started up.

Why is Jenkins Android Emulator Plugin recreating my Emulator Snapshots in every build?

I use Jenkins to build one of my projects. The Android Emulator Plugin automatically starts an emulator with the following configuration:
Configuration of the Emulator Plugin:
.
Every time the job is running I get the following output:
Erasing existing emulator data... $
/ci/home/tools/android-sdk//tools/emulator -no-boot-anim -ports
64470,64471 -prop persist.sys.language=de -prop persist.sys.country=DE
-avd hudson_de-DE_240_480x720_Google_Inc._Google_APIs_8 -no-snapshot-load -no-snapshot-save -wipe-data
.
.
shell input keyevent 4 [android] Giving the system some time to settle
before creating initial snapshot... $
.
.
localhost:64471 shell log -p v -t Jenkins "Creating snapshot..."
[android] Creating snapshot... $
Full log below.
It seems that the plugin is creating a new emulator every time and is not using snapshots.
This takes something between 2 and 4 minutes depending on the emulator configuration.
The plugin creates .avd and .ini files in the .android/avd directory inside the job folder. The avds are not deleted after the run process.
If I disable the use snapshots config the emulator needs less then a minute to start.
Is this an issue with the emulator plugin or are snapshots not possible because of my configuration?
I hope that using snapshots will speed up my building process a lot.
Full log:
$ /ci/home/tools/android-sdk//tools/android list target [android]
Using Android SDK: /ci/home/tools/android-sdk/ [android] Adding 200M
SD card to AVD 'hudson_de-DE_240_480x720_Google_Inc._Google_APIs_8'...
[android] Setting hardware properties: hw.ramSize: 512
$ /ci/home/tools/android-sdk//platform-tools/adb start-server
$ /ci/home/tools/android-sdk//tools/emulator -snapshot-list -no-window -avd hudson_de-DE_240_480x720_Google_Inc._Google_APIs_8
[android] Starting Android emulator and creating initial snapshot
[android] Erasing existing emulator data...
$ /ci/home/tools/android-sdk//tools/emulator -no-boot-anim -ports 64470,64471 -prop persist.sys.language=de -prop persist.sys.country=DE -avd hudson_de-DE_240_480x720_Google_Inc._Google_APIs_8 -no-snapshot-load -no-snapshot-save -wipe-data
* daemon not running. starting it now on port 64472 *
* daemon started successfully *
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
[android] Waiting for emulator to finish booting...
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471
shell getprop dev.bootcomplete error: device offline
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb disconnect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell getprop dev.bootcomplete
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 logcat -v time
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
[android] Attempting to unlock emulator screen
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell input keyevent 82
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell input keyevent 4
[android] Giving the system some time to settle before creating initial snapshot...
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 logcat -c
$ /ci/home/tools/android-sdk//platform-tools/adb -s localhost:64471 shell log -p v -t Jenkins "Creating snapshot..."
[android] Creating snapshot...
$ /ci/home/tools/android-sdk//platform-tools/adb connect localhost:64471
[android] Emulator is ready for use (took 158 seconds)
Buildfile for an example job:
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<name></name>
<refspec></refspec>
<url>git#project...</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<disableSubmodules>false</disableSubmodules>
<recursiveSubmodules>false</recursiveSubmodules>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<authorOrCommitter>false</authorOrCommitter>
<clean>false</clean>
<wipeOutWorkspace>false</wipeOutWorkspace>
<pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<useShallowClone>false</useShallowClone>
<buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
<gitTool>default</gitTool>
<submoduleCfg class="list"/>
<relativeTargetDir></relativeTargetDir>
<reference></reference>
<excludedRegions></excludedRegions>
<excludedUsers></excludedUsers>
<gitConfigName></gitConfigName>
<gitConfigEmail></gitConfigEmail>
<skipTag>false</skipTag>
<includedRegions></includedRegions>
<scmName></scmName>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>true</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>true</blockBuildWhenUpstreamBuilding>
<triggers class="vector">
<hudson.triggers.SCMTrigger>
<spec>*/5 * * * *</spec>
</hudson.triggers.SCMTrigger>
</triggers>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.Ant>
<targets>clean debug install</targets>
<antName>(Default)</antName>
</hudson.tasks.Ant>
<hudson.tasks.Ant>
<targets></targets>
<antName>(Default)</antName>
<buildFile>checkstyle-ant.xml</buildFile>
</hudson.tasks.Ant>
<hudson.tasks.Shell>
<command>os_opts="-Djava.awt.headless=true" lint --xml lint-results.xml .</command>
</hudson.tasks.Shell>
<hudson.plugins.android__emulator.monkey.MonkeyBuilder>
<packageId>de....</packageId>
<eventCount>1000</eventCount>
<throttleMs>10</throttleMs>
<seed>timestamp</seed>
</hudson.plugins.android__emulator.monkey.MonkeyBuilder>
<hudson.tasks.Shell>
... distribution script
</hudson.tasks.Shell>
</builders>
<publishers>
<org.jenkinsci.plugins.android__lint.LintPublisher>
<healthy></healthy>
<thresholdLimit>low</thresholdLimit>
<pluginName>[android-lint] </pluginName>
<defaultEncoding></defaultEncoding>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll></unstableTotalAll>
<unstableTotalHigh></unstableTotalHigh>
<unstableTotalNormal></unstableTotalNormal>
<unstableTotalLow></unstableTotalLow>
<unstableNewAll></unstableNewAll>
<unstableNewHigh></unstableNewHigh>
<unstableNewNormal></unstableNewNormal>
<unstableNewLow></unstableNewLow>
<failedTotalAll></failedTotalAll>
<failedTotalHigh></failedTotalHigh>
<failedTotalNormal></failedTotalNormal>
<failedTotalLow></failedTotalLow>
<failedNewAll></failedNewAll>
<failedNewHigh></failedNewHigh>
<failedNewNormal></failedNewNormal>
<failedNewLow></failedNewLow>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>false</dontComputeNew>
<doNotResolveRelativePaths>false</doNotResolveRelativePaths>
<pattern></pattern>
</org.jenkinsci.plugins.android__lint.LintPublisher>
<hudson.plugins.checkstyle.CheckStylePublisher>
<healthy></healthy>
<unHealthy></unHealthy>
<thresholdLimit>low</thresholdLimit>
<pluginName>[CHECKSTYLE] </pluginName>
<defaultEncoding></defaultEncoding>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll></unstableTotalAll>
<unstableTotalHigh></unstableTotalHigh>
<unstableTotalNormal></unstableTotalNormal>
<unstableTotalLow></unstableTotalLow>
<failedTotalAll></failedTotalAll>
<failedTotalHigh></failedTotalHigh>
<failedTotalNormal></failedTotalNormal>
<failedTotalLow></failedTotalLow>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>false</doNotResolveRelativePaths>
<pattern></pattern>
</hudson.plugins.checkstyle.CheckStylePublisher>
<hudson.plugins.warnings.WarningsPublisher>
<healthy></healthy>
<unHealthy></unHealthy>
<thresholdLimit>low</thresholdLimit>
<pluginName>[WARNINGS] </pluginName>
<defaultEncoding></defaultEncoding>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll></unstableTotalAll>
<unstableTotalHigh></unstableTotalHigh>
<unstableTotalNormal></unstableTotalNormal>
<unstableTotalLow></unstableTotalLow>
<failedTotalAll></failedTotalAll>
<failedTotalHigh></failedTotalHigh>
<failedTotalNormal></failedTotalNormal>
<failedTotalLow></failedTotalLow>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>true</doNotResolveRelativePaths>
<parserConfigurations/>
<consoleParsers>
<hudson.plugins.warnings.ConsoleParser>
<parserName>Java Compiler (Eclipse)</parserName>
</hudson.plugins.warnings.ConsoleParser>
</consoleParsers>
</hudson.plugins.warnings.WarningsPublisher>
<hudson.plugins.analysis.collector.AnalysisPublisher>
<healthy></healthy>
<unHealthy></unHealthy>
<thresholdLimit>low</thresholdLimit>
<pluginName>[ANALYSIS-COLLECTOR] </pluginName>
<defaultEncoding></defaultEncoding>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll></unstableTotalAll>
<unstableTotalHigh></unstableTotalHigh>
<unstableTotalNormal></unstableTotalNormal>
<unstableTotalLow></unstableTotalLow>
<failedTotalAll></failedTotalAll>
<failedTotalHigh></failedTotalHigh>
<failedTotalNormal></failedTotalNormal>
<failedTotalLow></failedTotalLow>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>true</doNotResolveRelativePaths>
<isCheckStyleDeactivated>false</isCheckStyleDeactivated>
<isDryDeactivated>true</isDryDeactivated>
<isFindBugsDeactivated>true</isFindBugsDeactivated>
<isPmdDeactivated>true</isPmdDeactivated>
<isOpenTasksDeactivated>true</isOpenTasksDeactivated>
<isWarningsDeactivated>false</isWarningsDeactivated>
</hudson.plugins.analysis.collector.AnalysisPublisher>
<hudson.plugins.android__emulator.monkey.MonkeyRecorder>
<failureOutcome>FAILURE</failureOutcome>
</hudson.plugins.android__emulator.monkey.MonkeyRecorder>
<hudson.plugins.cigame.GamePublisher/>
<hudson.tasks.Mailer>
<recipients></recipients>
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
<sendToIndividuals>true</sendToIndividuals>
</hudson.tasks.Mailer>
</publishers>
<buildWrappers>
<hudson.plugins.locksandlatches.LockWrapper>
<locks>
<hudson.plugins.locksandlatches.LockWrapper_-LockWaitConfig>
<name>AndroidEmulator</name>
</hudson.plugins.locksandlatches.LockWrapper_-LockWaitConfig>
</locks>
</hudson.plugins.locksandlatches.LockWrapper>
<hudson.plugins.android__emulator.AndroidEmulator>
<osVersion>Google Inc.:Google APIs:8</osVersion>
<screenDensity>240</screenDensity>
<screenResolution>480x720</screenResolution>
<deviceLocale>de_DE</deviceLocale>
<sdCardSize>200M</sdCardSize>
<hardwareProperties>
<hudson.plugins.android__emulator.AndroidEmulator_-HardwareProperty>
<key>hw.ramSize</key>
<value>512</value>
</hudson.plugins.android__emulator.AndroidEmulator_-HardwareProperty>
</hardwareProperties>
<wipeData>false</wipeData>
<showWindow>true</showWindow>
<useSnapshots>true</useSnapshots>
<deleteAfterBuild>false</deleteAfterBuild>
<startupDelay>0</startupDelay>
<commandLineOptions></commandLineOptions>
</hudson.plugins.android__emulator.AndroidEmulator>
</buildWrappers>
</project>
A bug was introduced in SDK Tools r20, whereby trying to list the available snapshots (via the emulator -snapshot-list command) would result in a crash.
Since the command crashes without listing the available snapshots, the Android Emulator Plugin believes that there are no existing snapshots, which causes a new snapshot to be created in every build.
I discovered that these crashes only occur with certain versions of the emulator application, i.e. it is possible to avoid the crash.
Thankfully, the Jenkins plugin lets you select the emulator binary to run.
So you can work around this problem by going into your job configuration, pressing Advanced… in the emulator config and selecting the "emulator-arm" (or another) binary.
In addition to Christopher Orr's answer, there is another possible cause. In my environment, emulator -snapshot-list listed the size of my snapshot as "1.0G". The pattern that matches snapshots in the Android Emulator Plugin as of 2014-01-14 matches whole number megabyte values.
I submitted a pull request to address that cause.

Categories

Resources