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.
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.
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.
I have Jenkins 1.568 installed on a Macbook Air running Ubuntu 14.04. I have the android emulator plugin installed, and the configuration I have set up runs the emulator in -no-window mode before starting each build.
About half of the builds are fine, but the other half, I get the following on the console:
[android] Starting Android emulator
$ /usr/local/src/android/android-sdk-linux/tools/emulator -no-boot-anim -ports 5782,5783 -avd Caesar -no-snapshot-load -no-snapshot-save -no-window -no-audio -no-skin -no-window
* daemon not running. starting it now on port 5784 *
* daemon started successfully *
Failed to Initialize backend EGL display
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
[android] Waiting for emulator to finish booting...
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
[android] Timed-out after waiting 360 seconds for emulator
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
[android] Stopping Android emulator
Clearly, the emulator is failing about 50% of the time. I'm not sure why, though, or how to fix it. Any suggestions would be welcome as to how I can get this running and not have to restart failed builds using naginator.
Try to update Java. I had android emulator problems in the past and a Java update fixed them.
Timeout problems.
DdmPreferences.setTimeOut is the global adb read/write packet timeout setting.
In 'at com.android.ddmlib.SyncService.doPushFile(SyncService.java:671)', DdmPreferences.getTimeOut() is called and used to set timeout.
In build.gradle:
android{
...
adbOptions {
timeOutInMs 10 * 60 * 1000 // 10 minutes
}
}
For Eclipse (Preferences -> Android -> DDMS).
Also, this is an environment variable that you set outside of build.gradle. On Ubuntu for instance:
$ export ADB_INSTALL_TIMEOUT=5
$ ./gradlew installDebug
Between runs:
sudo adb kill-server
and
sudo adb start-server
Here is a checklist to help:
1) You need the --all flag for both android list and android update sdk, otherwise some packages will not be installed: ex for SDK 24
1a)$ANDROID_HOME/tools/android list sdk --all
1b)
(for i in {1..100}; do echo y; sleep 1; done) |
$ANDROID_HOME/tools/android update sdk --no-ui --all --filter
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81,82,82,84,85,101,102,103,112,113,117,118,119,120,121,122,123,124
if you get the dreaded /home/jenkins/android-sdk-linux/platform-tools/adb -s emulator-XXXX shell getprop dev.bootcomplete error: device offline error, you are likely missing a package in step 1b
2)Ignore the dreaded Failed to Initialize backend EGL display error, it is a red herring
3)Be sure to use the Advanced Emulator options:
Emulator Options: -no-audio -gpu off
Emulator executable: emulator64-arm
Startup delay: 10 -- this *may* help
4)a pre-build script ${ANDROID_HOME}/platform-tools/adb kill-server can't hurt
check out Jenkins site https://issues.jenkins-ci.org/browse/JENKINS-27456
https://issues.jenkins-ci.org/browse/JENKINS-11952
you can also check this one https://code.google.com/p/android/issues/detail?id=209955 and http://www.yzjingying.net/4855150152.htm
Good luck!
I just found solution Android Emulator Plugin Failed to Initialize backend EGL display
Compare your job configuration with https://partnerdemo.ci.cloudbees.com/job/Android-dev/job/stockfish-android-cloud/, paying particular attention to the following settings:
Inject env var: LD_LIBRARY_PATH=/opt/android/android-sdk-linux/tool/lib
Target ABI: armeabi-v7a
Advanced -> Emulator Options: -no-audio -gpu off
Advanced -> Emulator Executable: emulator64-arm
I hope its helps you.
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.