Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11952

Emulator occasionally hangs indefinitely on startup, unable to connect adb

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Android-Emulator 1.19-SNAPSHOT (from git)
      Jenkins 1.438
      SDK r15

      Sometimes the emulator will fail to start up, this seems to only (or mostly) happen when snapshots are enabled. When this happens, it'll go in a loop of, until it times out:

      $ /opt/android-sdk/platform-tools/adb connect emu:38996,48597
      $ /opt/android-sdk/platform-tools/adb -s emulator-38996 shell getprop dev.bootcomplete

      This seems to be because sometimes the adb server never moves the device from the "offline" to the "online" status. Forcing a reconnect seems to fix this - like restarting the adb server.

          [JENKINS-11952] Emulator occasionally hangs indefinitely on startup, unable to connect adb

          A reason for the emulator not starting properly could be the high screen resolution. The emulator does not generally deal with this well, and the window server and various system services tend to go into an endless loop of crashing and restarting.

          So I would also try with a smaller screen resolution, and maybe lower screen density.

          We can't do much about the emulator being crappy, but maybe in these cases we should also (somehow) archive the logcat output (or instruct the user how to see the live logcat, or scan the log for system crashes) to better debug startup issues.

          Christopher Orr added a comment - A reason for the emulator not starting properly could be the high screen resolution. The emulator does not generally deal with this well, and the window server and various system services tend to go into an endless loop of crashing and restarting. So I would also try with a smaller screen resolution, and maybe lower screen density. We can't do much about the emulator being crappy, but maybe in these cases we should also (somehow) archive the logcat output (or instruct the user how to see the live logcat, or scan the log for system crashes) to better debug startup issues.

          Yeah, I tried the same config as Guillaume above, and got the same failure to boot.

          I ran this on my Jenkins slave while waiting for the emulator startup to time-out:
          ANDROID_ADB_SERVER_PORT=5829 ~/jenkins/tools/android-sdk/platform-tools/adb logcat

          There I saw a loop of /system/bin/surfaceflinger native crashes.

          Christopher Orr added a comment - Yeah, I tried the same config as Guillaume above, and got the same failure to boot. I ran this on my Jenkins slave while waiting for the emulator startup to time-out: ANDROID_ADB_SERVER_PORT=5829 ~/jenkins/tools/android-sdk/platform-tools/adb logcat There I saw a loop of /system/bin/surfaceflinger native crashes.

          I extended my patch series to capture logcat output irrespective of whether boot completes or not. The change was quite simple although I did have to put a short delay in to allow the logcat output to be captured before the emulator was killed after a failed boot.

          A test build can be downloaded from
          android-emulator-2.12-SNAPSHOT.hpi

          Pull request at
          https://github.com/jenkinsci/android-emulator-plugin/pull/39

          Note the pull request still contains the devices -l output. For now I think that will be useful in diagnosing the various causes of boot failures that may be out there. I'm not sure whether it just makes the logs too messy to be included long term.

          I'm also considering getting rid of the connect and disconnect operations. I don't think they add anything to the robustness of startup now we are using the emulator-xxxx style device name.

          Richard Mortimer added a comment - I extended my patch series to capture logcat output irrespective of whether boot completes or not. The change was quite simple although I did have to put a short delay in to allow the logcat output to be captured before the emulator was killed after a failed boot. A test build can be downloaded from android-emulator-2.12-SNAPSHOT.hpi Pull request at https://github.com/jenkinsci/android-emulator-plugin/pull/39 Note the pull request still contains the devices -l output. For now I think that will be useful in diagnosing the various causes of boot failures that may be out there. I'm not sure whether it just makes the logs too messy to be included long term. I'm also considering getting rid of the connect and disconnect operations. I don't think they add anything to the robustness of startup now we are using the emulator-xxxx style device name.

          Guillaume added a comment -

          You're right, trying with emulators of different resolution / density I was able to connect to it in some instances (although it still fails sometimes, but I couldn't investigate it much yet).
          Sorry for polluting the thread with an unrelated error. Eventually the patch seems to have solved the current issue for me (again, in some cases, I'll come back if I find out more and it seems directly related to this issue).

          Thanks for helping out.

          Guillaume added a comment - You're right, trying with emulators of different resolution / density I was able to connect to it in some instances (although it still fails sometimes, but I couldn't investigate it much yet). Sorry for polluting the thread with an unrelated error. Eventually the patch seems to have solved the current issue for me (again, in some cases , I'll come back if I find out more and it seems directly related to this issue). Thanks for helping out.

          Hi. I'm using the 2.12-Snapshot Android Emulator Plugin from the pull 39 link/post on Mac OS X 10.9 and Android SDK Revision 23.0.2

          I'm not sure if my problem is 100% the problem described here. Here my problem: If my Jenkins job starts then the Android Emulator sometimes starts without any problem and sometimes I get the device offline notification. I can't reproduce, when the emulator will work fine or will fail to start. I tried different screen sizes and I was using an existing emulator and I created a new emulator while the Jenkins jobs. I don't know what further steps I can do. So I will post my log and hope you can help me.

           $ /Library/android-sdk-macosx/tools/android list target
          [android] Using Android SDK: /Library/android-sdk-macosx
          [android] Creating Android AVD: /Users/Shared/Jenkins/Home/jobs/(placeholder)/workspace/.android/avd/hudson_de-DE_160_HVGA_Google_Inc._Google_APIs_19_armeabi-v7a.avd
          [android] /Library/android-sdk-macosx/tools/android create avd -f -a -s HVGA -n hudson_de-DE_160_HVGA_Google_Inc._Google_APIs_19_armeabi-v7a -t "Google Inc.:Google APIs:19" --abi armeabi-v7a
          $ /Library/android-sdk-macosx/platform-tools/adb start-server
          * daemon not running. starting it now on port 5897 *
          * daemon started successfully *
          $ /Library/android-sdk-macosx/platform-tools/adb start-server
          [android] Starting Android emulator
          $ /Library/android-sdk-macosx/tools/emulator -no-boot-anim -ports 5895,5896 -prop persist.sys.language=de -prop persist.sys.country=DE -avd hudson_de-DE_160_HVGA_Google_Inc._Google_APIs_19_armeabi-v7a -no-snapshot-load -no-snapshot-save -wipe-data -no-window
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          [android] Waiting for emulator to finish booting...
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb devices -l
          List of devices attached 
          emulator-5895          offline
          
          [android] adb devices returned 0
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete
          error: device offline
          error: device offline
          $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895
          $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 logcat -v time
          [android] Timed-out after waiting 720 seconds for emulator
          $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895
          [android] Stopping Android emulator
          $ /Library/android-sdk-macosx/platform-tools/adb kill-server
          Archiving artifacts
          Finished: NOT_BUILT
          

          If I'm at the wrong place for my request please show me a web side where I can post my problem.
          Thanks for your help.

          Tobias Schumacher added a comment - Hi. I'm using the 2.12-Snapshot Android Emulator Plugin from the pull 39 link/post on Mac OS X 10.9 and Android SDK Revision 23.0.2 I'm not sure if my problem is 100% the problem described here. Here my problem: If my Jenkins job starts then the Android Emulator sometimes starts without any problem and sometimes I get the device offline notification. I can't reproduce, when the emulator will work fine or will fail to start. I tried different screen sizes and I was using an existing emulator and I created a new emulator while the Jenkins jobs. I don't know what further steps I can do. So I will post my log and hope you can help me. $ /Library/android-sdk-macosx/tools/android list target [android] Using Android SDK: /Library/android-sdk-macosx [android] Creating Android AVD: /Users/Shared/Jenkins/Home/jobs/(placeholder)/workspace/.android/avd/hudson_de-DE_160_HVGA_Google_Inc._Google_APIs_19_armeabi-v7a.avd [android] /Library/android-sdk-macosx/tools/android create avd -f -a -s HVGA -n hudson_de-DE_160_HVGA_Google_Inc._Google_APIs_19_armeabi-v7a -t "Google Inc.:Google APIs:19" --abi armeabi-v7a $ /Library/android-sdk-macosx/platform-tools/adb start-server * daemon not running. starting it now on port 5897 * * daemon started successfully * $ /Library/android-sdk-macosx/platform-tools/adb start-server [android] Starting Android emulator $ /Library/android-sdk-macosx/tools/emulator -no-boot-anim -ports 5895,5896 -prop persist.sys.language=de -prop persist.sys.country=DE -avd hudson_de-DE_160_HVGA_Google_Inc._Google_APIs_19_armeabi-v7a -no-snapshot-load -no-snapshot-save -wipe-data -no-window $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 [android] Waiting for emulator to finish booting... $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb devices -l List of devices attached emulator-5895 offline [android] adb devices returned 0 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 shell getprop dev.bootcomplete error: device offline error: device offline $ /Library/android-sdk-macosx/platform-tools/adb connect emulator-5895 $ /Library/android-sdk-macosx/platform-tools/adb -s emulator-5895 logcat -v time [android] Timed-out after waiting 720 seconds for emulator $ /Library/android-sdk-macosx/platform-tools/adb disconnect emulator-5895 [android] Stopping Android emulator $ /Library/android-sdk-macosx/platform-tools/adb kill-server Archiving artifacts Finished: NOT_BUILT If I'm at the wrong place for my request please show me a web side where I can post my problem. Thanks for your help.

          Tobias thanks for posting your logs. This does look very much like the original problem that has been reported.

          It looks like the emulator does do the initial attach to ADB but then never transitions to online state. I don't think the emulator is crashing/exiting because that would cause the listing in devices -l to go away.

          Did you get a logcat file archived for one of the failed jobs? It doesn't look like it did.

          Do you have access to any of the Mac OS system logs? If so it would be a good idea to have a look in them to see if there are any "interesting" events around the time of the failure. There may be out-of-memory issues or other system resource starvation issues that could cause a strange failure mode.

          Richard Mortimer added a comment - Tobias thanks for posting your logs. This does look very much like the original problem that has been reported. It looks like the emulator does do the initial attach to ADB but then never transitions to online state. I don't think the emulator is crashing/exiting because that would cause the listing in devices -l to go away. Did you get a logcat file archived for one of the failed jobs? It doesn't look like it did. Do you have access to any of the Mac OS system logs? If so it would be a good idea to have a look in them to see if there are any "interesting" events around the time of the failure. There may be out-of-memory issues or other system resource starvation issues that could cause a strange failure mode.

          Richard thanks for your very fast reply. I looked into the logcat of the Jenkins job. I compared one log of a failed build and one of a succeeded build. I saw no difference in the log. I uploaded the log for you. Maybe you see something critical. https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/logcat

          I looked into the /var/log/system.log too. I only noticed this:
          vmhost-mac-mini.local launchctl[3904]: launchctl: Dubious ownership on file (skipping): /Library/LaunchAgents/org.jenkins-ci.plist
          This is also shown at a successful build. So I think this is not the problem.

          At the DiagnosticReports I don't see any log from adb or emultor64-arm. The activity log marks the emulator64-arm as not responding after a few seconds and the last system error counter increases with time. Nothing special at all messages of Console too.

          I'm new at the Mac and Android world. So if you know an other log I can lock at, it would be nice you can name it.
          I can't reproduce any steps to say, if I do this the build fails and if I do this the build succeeds. From my perspective, the problem is random.

          Tobias Schumacher added a comment - Richard thanks for your very fast reply. I looked into the logcat of the Jenkins job. I compared one log of a failed build and one of a succeeded build. I saw no difference in the log. I uploaded the log for you. Maybe you see something critical. https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/logcat I looked into the /var/log/system.log too. I only noticed this: vmhost-mac-mini.local launchctl [3904] : launchctl: Dubious ownership on file (skipping): /Library/LaunchAgents/org.jenkins-ci.plist This is also shown at a successful build. So I think this is not the problem. At the DiagnosticReports I don't see any log from adb or emultor64-arm. The activity log marks the emulator64-arm as not responding after a few seconds and the last system error counter increases with time. Nothing special at all messages of Console too. I'm new at the Mac and Android world. So if you know an other log I can lock at, it would be nice you can name it. I can't reproduce any steps to say, if I do this the build fails and if I do this the build succeeds. From my perspective, the problem is random.

          Tobias can you post a "good" log too. That would be helpful for myself/others to make sense of the various warnings/errors in the log that are just "normal".

          That said around like 2834 of your log the following exists

          D/AlertReceiver( 1323): onReceive: a=android.intent.action.BOOT_COMPLETED Intent { act=android.intent.action.BOOT_COMPLETED flg=0x8000010 cmp=com.android.calendar/.alerts.AlertReceiver (has extras) }
          I/ActivityManager( 384): Delay finish: com.android.calendar/.alerts.AlertReceiver
          D/AlertUtils( 1323): Flushing old alerts from shared prefs table
          D/AlertService( 1323): 0 Action = android.intent.action.BOOT_COMPLETED
          

          This suggests to me that the emulator thinks that boot has completed but that it is not connected to ADB properly. That would add some weight to the theory that something is going wrong in the early emulator<->ADB communications.

          Richard Mortimer added a comment - Tobias can you post a "good" log too. That would be helpful for myself/others to make sense of the various warnings/errors in the log that are just "normal". That said around like 2834 of your log the following exists D/AlertReceiver( 1323): onReceive: a=android.intent.action.BOOT_COMPLETED Intent { act=android.intent.action.BOOT_COMPLETED flg=0x8000010 cmp=com.android.calendar/.alerts.AlertReceiver (has extras) } I/ActivityManager( 384): Delay finish: com.android.calendar/.alerts.AlertReceiver D/AlertUtils( 1323): Flushing old alerts from shared prefs table D/AlertService( 1323): 0 Action = android.intent.action.BOOT_COMPLETED This suggests to me that the emulator thinks that boot has completed but that it is not connected to ADB properly. That would add some weight to the theory that something is going wrong in the early emulator<->ADB communications.

          I have added a "good" log now. https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/successful_build_log
          I didn't find the passage you mentioned in the "good" log.

          Tobias Schumacher added a comment - I have added a "good" log now. https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/successful_build_log I didn't find the passage you mentioned in the "good" log.

          Hi. I noticed two things. I don't know if these informations are important or not.
          First: If I start a Job and the device is listed as offline, I see the device as offline in the Terminal too. (If I listen to the port of the adb server of Jenkins)
          Second: I tried to use -tcpdump at the emulator settings of Jenkins, but I have no permission to do that. I tried to change the user of Jenkins to admin but it failed. So I can't log the communication. Richard do you have the same problem with tcpdump?

          I tried to log the communication between the emulator and Jenkins with wireshark. I only noticed a few TCP Out-Of-Order notifications. But these are at a failed and a "goog" build. So I think this is not the problem.
          Richard how did you install Jenkins and how are you running it? Maybe it's because of my way using Jenkins which causes the emulator problem. It seems that the plugin is running well at your Jenkins(correct me if this information is false). (Only if you want to share this and it's not to much work. A link to a webside is possible too.)
          I installed it with the jenkins.dmg and created a jenkins user which is running Jenkins with the command "/usr/bin/java -Dfile.encoding=UTF-8 -XX:PermSize=265m -XX:MaxPermSize=512 -Xms256m -Xmx512m -Djava.io.tmpdir=/Users/Shared/Jenkins/tmp -jar /Applications/Jenkins/jenkins.war". My org.jenkins-ci.plist file is located at "/Library/LaunchAgents/".

          Tobias Schumacher added a comment - Hi. I noticed two things. I don't know if these informations are important or not. First: If I start a Job and the device is listed as offline, I see the device as offline in the Terminal too. (If I listen to the port of the adb server of Jenkins) Second: I tried to use -tcpdump at the emulator settings of Jenkins, but I have no permission to do that. I tried to change the user of Jenkins to admin but it failed. So I can't log the communication. Richard do you have the same problem with tcpdump? I tried to log the communication between the emulator and Jenkins with wireshark. I only noticed a few TCP Out-Of-Order notifications. But these are at a failed and a "goog" build. So I think this is not the problem. Richard how did you install Jenkins and how are you running it? Maybe it's because of my way using Jenkins which causes the emulator problem. It seems that the plugin is running well at your Jenkins(correct me if this information is false). (Only if you want to share this and it's not to much work. A link to a webside is possible too.) I installed it with the jenkins.dmg and created a jenkins user which is running Jenkins with the command "/usr/bin/java -Dfile.encoding=UTF-8 -XX:PermSize=265m -XX:MaxPermSize=512 -Xms256m -Xmx512m -Djava.io.tmpdir=/Users/Shared/Jenkins/tmp -jar /Applications/Jenkins/jenkins.war". My org.jenkins-ci.plist file is located at "/Library/LaunchAgents/".

          Tobias,

          first point

          I would expect adb in the terminal to report offline too. The adb command connects to the adb server to find out that information so it should be consistent.

          I think you just said that there is only one adb server process running but it would be good to confirm that to ensure that the emulator is not managing to talk to another instance of adb.

          tcpdump option

          I have never tried the -tcpdump option so I cannot comment. But I do believe that it only captures the emulator's virtual Ethernet LAN so I would not expect it to capture the communications with ADB.

          Where did you ask -tcpdump to save the PCAP file to? You probably need to specify a full pathname and make sure that it is writable. Maybe try a file in /Users/Share/Jenkins/tmp/ as that is your tmpdir specified in your Jenkins commandline.

          setup

          My master is installed on an Ubuntu 14.04 server using the standard .deb packaging. The android emulator runs on a Ubuntu 14.04 slave connected via jnlp that is launched using

          /usr/bin/java -Xms256m -Xmx512m -jar /usr/share/jenkslav/slave.jar -jnlpUrl file:///opt/jenkins/slave/slave-agent.jnlp

          I have in the past used a Windows 7 slave machine (installed as a service) connecting via jnlp for the emulator. But most of my recent usage/testing has been on Ubuntu 14.04. I've never tried running a slave/emulator on MacOS X so that may explain the different experience that you have.

          wireshark/tcpdump

          If you can try again with wireshark (or commandline tcpdump) to capture the traffic between adb and the emulator that should help to diagnose the problem. The two will communicate via localhost (127.0.0.1) so you will need to make sure that you are capturing on that interface and not on a LAN.

          I would suggest that you capture all traffic and then filter for the ports used by adb/emulator after the build has failed. I'll happily have a look at the filtered capture but I would suggest that you zip/email it direct to me rather than posting somewhere public.

          Richard Mortimer added a comment - Tobias, first point I would expect adb in the terminal to report offline too. The adb command connects to the adb server to find out that information so it should be consistent. I think you just said that there is only one adb server process running but it would be good to confirm that to ensure that the emulator is not managing to talk to another instance of adb. tcpdump option I have never tried the -tcpdump option so I cannot comment. But I do believe that it only captures the emulator's virtual Ethernet LAN so I would not expect it to capture the communications with ADB. Where did you ask -tcpdump to save the PCAP file to? You probably need to specify a full pathname and make sure that it is writable. Maybe try a file in /Users/Share/Jenkins/tmp/ as that is your tmpdir specified in your Jenkins commandline. setup My master is installed on an Ubuntu 14.04 server using the standard .deb packaging. The android emulator runs on a Ubuntu 14.04 slave connected via jnlp that is launched using /usr/bin/java -Xms256m -Xmx512m -jar /usr/share/jenkslav/slave.jar -jnlpUrl file:///opt/jenkins/slave/slave-agent.jnlp I have in the past used a Windows 7 slave machine (installed as a service) connecting via jnlp for the emulator. But most of my recent usage/testing has been on Ubuntu 14.04. I've never tried running a slave/emulator on MacOS X so that may explain the different experience that you have. wireshark/tcpdump If you can try again with wireshark (or commandline tcpdump) to capture the traffic between adb and the emulator that should help to diagnose the problem. The two will communicate via localhost (127.0.0.1) so you will need to make sure that you are capturing on that interface and not on a LAN. I would suggest that you capture all traffic and then filter for the ports used by adb/emulator after the build has failed. I'll happily have a look at the filtered capture but I would suggest that you zip/email it direct to me rather than posting somewhere public.

          Tobias Schumacher added a comment - - edited

          Hi Richard,

          tcpdump option
          It worked with a full pathname. I have added a "bad" (adb server port 5615, emulator port 5613)
          and a "good" log (adb server port 5613, emulator port 5611)
          https://github.com/ITobiI/Android-Problem-Jenkins/tree/master/EmulatorTcpdump.

          Wireshark
          I recorded some communication and uploaded a "good" (adb server port 5751, emulator port 5749)
          and "bad" (adb server port 5753, emulator port 5751)
          log too https://github.com/ITobiI/Android-Problem-Jenkins/tree/master/Wireshark.

          I tried to look into it but it's hard to compare these files. I hope the logs will help.

          Edit:
          I forgot to say that there are two adb processes at the beginning and after 1 or 2 seconds only 1 left. So there aren't any other adb servers running.

          Tobias Schumacher added a comment - - edited Hi Richard, tcpdump option It worked with a full pathname. I have added a "bad" (adb server port 5615, emulator port 5613) and a "good" log (adb server port 5613, emulator port 5611) https://github.com/ITobiI/Android-Problem-Jenkins/tree/master/EmulatorTcpdump . Wireshark I recorded some communication and uploaded a "good" (adb server port 5751, emulator port 5749) and "bad" (adb server port 5753, emulator port 5751) log too https://github.com/ITobiI/Android-Problem-Jenkins/tree/master/Wireshark . I tried to look into it but it's hard to compare these files. I hope the logs will help. Edit: I forgot to say that there are two adb processes at the beginning and after 1 or 2 seconds only 1 left. So there aren't any other adb servers running.

          Do you have the console and logcat output logs for each of the good and bad examples? That would help to match things up with events in the packet capture.

          Richard Mortimer added a comment - Do you have the console and logcat output logs for each of the good and bad examples? That would help to match things up with events in the packet capture.

          I've had a quick look over the Wireshark captures. In the "bad" capture the emulator never responds to the connection (CNXN) request from ADB and at first glance that seems to jam the whole adb<->emulator connection up.

          I haven't worked out whether ADB or the emulator is a fault because ADB only gives the emulator about 0.5 second to respond before it forcefully closes the connection. The emulator doesn't release (TCP FIN) its end of the connection for about another 17 seconds.

          For reference this all occurs in the TCP connection from port 62625 to port 5752 that starts at packet 371 in the bad pcap file.

          Good connection looks like

          00000000  43 4e 58 4e 00 00 00 01  00 10 00 00 07 00 00 00 CNXN.... ........
          00000010  32 02 00 00 bc b1 a7 b1  68 6f 73 74 3a 3a 00    2....... host::.
              00000000  43 4e 58 4e 00 00 00 01  00 10 00 00 5a 00 00 00 CNXN.... ....Z...
              00000010  41 22 00 00 bc b1 a7 b1  64 65 76 69 63 65 3a 3a A"...... device::
              00000020  72 6f 2e 70 72 6f 64 75  63 74 2e 6e 61 6d 65 3d ro.produ ct.name=
              00000030  67 6f 6f 67 6c 65 5f 73  64 6b 3b 72 6f 2e 70 72 google_s dk;ro.pr
              00000040  6f 64 75 63 74 2e 6d 6f  64 65 6c 3d 67 6f 6f 67 oduct.mo del=goog
              00000050  6c 65 5f 73 64 6b 3b 72  6f 2e 70 72 6f 64 75 63 le_sdk;r o.produc
              00000060  74 2e 64 65 76 69 63 65  3d 67 65 6e 65 72 69 63 t.device =generic
              00000070  3b 00                                            ;.
          0000001F  4f 50 45 4e 17 00 00 00  00 00 00 00 1f 00 00 00 OPEN.... ........
          0000002F  ed 0b 00 00 b0 af ba b1  73 68 65 6c 6c 3a 67 65 ........ shell:ge
          0000003F  74 70 72 6f 70 20 64 65  76 2e 62 6f 6f 74 63 6f tprop de v.bootco
          0000004F  6d 70 6c 65 74 65 00                             mplete.
              00000072  4f 4b 41 59 01 00 00 00  17 00 00 00 00 00 00 00 OKAY.... ........
              00000082  00 00 00 00 b0 b4 be a6                          ........ 
              0000008A  57 52 54 45 01 00 00 00  17 00 00 00 02 00 00 00 WRTE.... ........
              0000009A  17 00 00 00 a8 ad ab ba  0d 0a                   ........ ..
          00000056  4f 4b 41 59 17 00 00 00  01 00 00 00 00 00 00 00 OKAY.... ........
          00000066  00 00 00 00 b0 b4 be a6                          ........ 
              000000A4  43 4c 53 45 00 00 00 00  17 00 00 00 00 00 00 00 CLSE.... ........
              000000B4  00 00 00 00 bc b3 ac ba                          ........ 
          0000006E  43 4c 53 45 17 00 00 00  01 00 00 00 00 00 00 00 CLSE.... ........
          0000007E  00 00 00 00 bc b3 ac ba                          ........ 
          ... truncated here because it is uninteresting for our purposes...
          

          Bad connection stream contains

          00000000  43 4e 58 4e 00 00 00 01  00 10 00 00 07 00 00 00 CNXN.... ........
          00000010  32 02 00 00 bc b1 a7 b1  68 6f 73 74 3a 3a 00    2....... host::.
          

          I likely will not get to look at this further for at least the next 36 hours. I will do a bit of digging in the emulator/ADB code to see if my analysis matches what the code does once I get some spare time.

          Richard Mortimer added a comment - I've had a quick look over the Wireshark captures. In the "bad" capture the emulator never responds to the connection (CNXN) request from ADB and at first glance that seems to jam the whole adb<->emulator connection up. I haven't worked out whether ADB or the emulator is a fault because ADB only gives the emulator about 0.5 second to respond before it forcefully closes the connection. The emulator doesn't release (TCP FIN) its end of the connection for about another 17 seconds. For reference this all occurs in the TCP connection from port 62625 to port 5752 that starts at packet 371 in the bad pcap file. Good connection looks like 00000000 43 4e 58 4e 00 00 00 01 00 10 00 00 07 00 00 00 CNXN.... ........ 00000010 32 02 00 00 bc b1 a7 b1 68 6f 73 74 3a 3a 00 2....... host::. 00000000 43 4e 58 4e 00 00 00 01 00 10 00 00 5a 00 00 00 CNXN.... ....Z... 00000010 41 22 00 00 bc b1 a7 b1 64 65 76 69 63 65 3a 3a A"...... device:: 00000020 72 6f 2e 70 72 6f 64 75 63 74 2e 6e 61 6d 65 3d ro.produ ct.name= 00000030 67 6f 6f 67 6c 65 5f 73 64 6b 3b 72 6f 2e 70 72 google_s dk;ro.pr 00000040 6f 64 75 63 74 2e 6d 6f 64 65 6c 3d 67 6f 6f 67 oduct.mo del=goog 00000050 6c 65 5f 73 64 6b 3b 72 6f 2e 70 72 6f 64 75 63 le_sdk;r o.produc 00000060 74 2e 64 65 76 69 63 65 3d 67 65 6e 65 72 69 63 t.device =generic 00000070 3b 00 ;. 0000001F 4f 50 45 4e 17 00 00 00 00 00 00 00 1f 00 00 00 OPEN.... ........ 0000002F ed 0b 00 00 b0 af ba b1 73 68 65 6c 6c 3a 67 65 ........ shell:ge 0000003F 74 70 72 6f 70 20 64 65 76 2e 62 6f 6f 74 63 6f tprop de v.bootco 0000004F 6d 70 6c 65 74 65 00 mplete. 00000072 4f 4b 41 59 01 00 00 00 17 00 00 00 00 00 00 00 OKAY.... ........ 00000082 00 00 00 00 b0 b4 be a6 ........ 0000008A 57 52 54 45 01 00 00 00 17 00 00 00 02 00 00 00 WRTE.... ........ 0000009A 17 00 00 00 a8 ad ab ba 0d 0a ........ .. 00000056 4f 4b 41 59 17 00 00 00 01 00 00 00 00 00 00 00 OKAY.... ........ 00000066 00 00 00 00 b0 b4 be a6 ........ 000000A4 43 4c 53 45 00 00 00 00 17 00 00 00 00 00 00 00 CLSE.... ........ 000000B4 00 00 00 00 bc b3 ac ba ........ 0000006E 43 4c 53 45 17 00 00 00 01 00 00 00 00 00 00 00 CLSE.... ........ 0000007E 00 00 00 00 bc b3 ac ba ........ ... truncated here because it is uninteresting for our purposes... Bad connection stream contains 00000000 43 4e 58 4e 00 00 00 01 00 10 00 00 07 00 00 00 CNXN.... ........ 00000010 32 02 00 00 bc b1 a7 b1 68 6f 73 74 3a 3a 00 2....... host::. I likely will not get to look at this further for at least the next 36 hours. I will do a bit of digging in the emulator/ADB code to see if my analysis matches what the code does once I get some spare time.

          I uploaded a new Wireshark log and the Jenkins logcat log. These are matching now (the name of the file should be enough to match the files). At the last Wireshark log I didn't use logcat, so I needed to take a new log. Here the link. https://github.com/ITobiI/Android-Problem-Jenkins/tree/master/WiresharkAndJenkinsLogcat

          I found the CNXN passage at packet number 296 at the bad log (I didn't see any other CNXN) and number 829 at the good log.

          Tobias Schumacher added a comment - I uploaded a new Wireshark log and the Jenkins logcat log. These are matching now (the name of the file should be enough to match the files). At the last Wireshark log I didn't use logcat, so I needed to take a new log. Here the link. https://github.com/ITobiI/Android-Problem-Jenkins/tree/master/WiresharkAndJenkinsLogcat I found the CNXN passage at packet number 296 at the bad log (I didn't see any other CNXN) and number 829 at the good log.

          Richard Mortimer added a comment - - edited

          Given the error symptoms it looks like we can enable to tracing in ADB to get it to tell more information about what is going on. Just set the environment variable ADB_TRACE to adb,transport for the job (or as a global environment variable in the jenkins configuration). You might need the EnvInject plugin installed to do this.

          Now when the build runs it will log additional information in the console output. The ADB server will also log to /tmp/adb.log. That location is hardcoded and cannot be changed so you need to grab that after the build. Also make sure that you remove it before the next build or it will append the new log onto the end.

          If it is configured right you will see lots of messages similar to the following:

          system/core/adb/adb_client.c::_adb_connect():_adb_connect: return fd 3
          system/core/adb/adb_client.c::adb_connect():adb_connect: return fd 3
          system/core/adb/transport.c::readx():readx: fd=3 wanted=4
          system/core/adb/transport.c::readx():readx: fd=3 wanted=4 got=4
          30303237 0027
          

          I don't really think you need to capture the "good" logs anymore we have enough examples of that so you might as well save some uploading time.

          Richard Mortimer added a comment - - edited Given the error symptoms it looks like we can enable to tracing in ADB to get it to tell more information about what is going on. Just set the environment variable ADB_TRACE to adb,transport for the job (or as a global environment variable in the jenkins configuration). You might need the EnvInject plugin installed to do this. Now when the build runs it will log additional information in the console output. The ADB server will also log to /tmp/adb.log . That location is hardcoded and cannot be changed so you need to grab that after the build. Also make sure that you remove it before the next build or it will append the new log onto the end. If it is configured right you will see lots of messages similar to the following: system/core/adb/adb_client.c::_adb_connect():_adb_connect: return fd 3 system/core/adb/adb_client.c::adb_connect():adb_connect: return fd 3 system/core/adb/transport.c::readx():readx: fd=3 wanted=4 system/core/adb/transport.c::readx():readx: fd=3 wanted=4 got=4 30303237 0027 I don't really think you need to capture the "good" logs anymore we have enough examples of that so you might as well save some uploading time.

          First I used adb and transport with adb_trace for my build. I see some errors but these are at a good log too. So I changed the adb_trace to all. I compared a bad and a good log. I noticed at line 228 and line 252 a difference. At line 228 there is "shell@generic:/ & W/surfaceFlinger..." written in the good log. At line 252 there is the "Thread AudioOut_2 cannot connect to the" written in the good log. Apart from that only the order of some commands/notifications is different. I look into the log until the emulator was started at the good log (third time adb devices -l is used).

          Here the bad log: https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/adb_trace%20all

          Tobias Schumacher added a comment - First I used adb and transport with adb_trace for my build. I see some errors but these are at a good log too. So I changed the adb_trace to all. I compared a bad and a good log. I noticed at line 228 and line 252 a difference. At line 228 there is "shell@generic:/ & W/surfaceFlinger..." written in the good log. At line 252 there is the "Thread AudioOut_2 cannot connect to the" written in the good log. Apart from that only the order of some commands/notifications is different. I look into the log until the emulator was started at the good log (third time adb devices -l is used). Here the bad log: https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/adb_trace%20all

          can you grab /tmp/adb.log too please. That will have the more interesting ADB server side of the story.

          Richard Mortimer added a comment - can you grab /tmp/adb.log too please. That will have the more interesting ADB server side of the story.

          Here the log: https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/bad_adb.log

          At the good dab.log there are these two lines:
          setting connection_state to CS_DEVICE
          adb: online

          Tobias Schumacher added a comment - Here the log: https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/bad_adb.log At the good dab.log there are these two lines: setting connection_state to CS_DEVICE adb: online

          The bad_adb.log file does not look like what I expected at all. It seems to be logging socket level information but not adb or transport. It maybe that things operate differently on OS X but if you could check that you did capture the log at the correct level please. It might also be worth making /tmp/adb.log world writeable, chmod a+x /tmp/adb.log, just in case there is something else creating the log first.

          Richard Mortimer added a comment - The bad_adb.log file does not look like what I expected at all. It seems to be logging socket level information but not adb or transport . It maybe that things operate differently on OS X but if you could check that you did capture the log at the correct level please. It might also be worth making /tmp/adb.log world writeable, chmod a+x /tmp/adb.log , just in case there is something else creating the log first.

          adb_trace was first only in the jenkins environment. I changed it to be global. It works now for jenkins and the terminal but not for the adb.log of the adb server. I searched for a solution but I didn't find one. I only read that adb_trace should change the adb client and server log.

          I noticed that the loglevel of the emulator can be changed at the init.rc file. I tried it, but I can't get write permission (download to computer, change file and upload to emulator[last step failed]). Maybe my superuser access is currupted. Would it be helpful to change the loglevel of the emulator? If yes, then I will try it a second time.

          Tobias Schumacher added a comment - adb_trace was first only in the jenkins environment. I changed it to be global. It works now for jenkins and the terminal but not for the adb.log of the adb server. I searched for a solution but I didn't find one. I only read that adb_trace should change the adb client and server log. I noticed that the loglevel of the emulator can be changed at the init.rc file. I tried it, but I can't get write permission (download to computer, change file and upload to emulator [last step failed] ). Maybe my superuser access is currupted. Would it be helpful to change the loglevel of the emulator? If yes, then I will try it a second time.

          You should only need to set the ADB_TRACE environment variable in Jenkins. The android-emulator-plugin starts ADB from within the job and kills it at the end. Ideally you should make sure that no other ADB server/emulator instance is running outside of jenkins to avoid complicating things. It does make sense to ensure that /tmp/adb.log does not exist before the jenkins job starts to ensure that there are no file permissions issues when the ADB server tries to open the log.

          I don't think that the emulator loglevel change would be useful at this time.

          Richard Mortimer added a comment - You should only need to set the ADB_TRACE environment variable in Jenkins. The android-emulator-plugin starts ADB from within the job and kills it at the end. Ideally you should make sure that no other ADB server/emulator instance is running outside of jenkins to avoid complicating things. It does make sense to ensure that /tmp/adb.log does not exist before the jenkins job starts to ensure that there are no file permissions issues when the ADB server tries to open the log. I don't think that the emulator loglevel change would be useful at this time.

          I think my adb is broken. I see the adb start-server two times.

          $ adb start-server

          • failed to start daemon *
          • daemon not running. starting it now on port 5801 *
            $ adb start-server

          The adb log starts with:
          remote local: read terminated (message)
          adb: offline
          check_header(): invalid magic
          bad header: terminated (data)
          adb: offline

          After this output there is only the sockel level log. So at the first adb start-server the log is correct. But not at the second one. I will look into it.

          I can see this at the process too. One adb process appears. Then appears a second one. After 1 second the first (I'm not 100% sure) disappears. This phenomenon started one month ago. The android emulator had the problem befor this change too. Maybe my adb installation is broken. I will reinstall/reconfigure it.
          I'm coming back on Thursday. I can't work on this issue until then.

          Tobias Schumacher added a comment - I think my adb is broken. I see the adb start-server two times. $ adb start-server failed to start daemon * daemon not running. starting it now on port 5801 * $ adb start-server The adb log starts with: remote local: read terminated (message) adb: offline check_header(): invalid magic bad header: terminated (data) adb: offline After this output there is only the sockel level log. So at the first adb start-server the log is correct. But not at the second one. I will look into it. I can see this at the process too. One adb process appears. Then appears a second one. After 1 second the first (I'm not 100% sure) disappears. This phenomenon started one month ago. The android emulator had the problem befor this change too. Maybe my adb installation is broken. I will reinstall/reconfigure it. I'm coming back on Thursday. I can't work on this issue until then.

          Cuong Thai added a comment - - edited

          I have been around this issue for two days. Here is my configuration that is working at least 4 times continuously.

          Here is the log:
          http://pastebin.com/2fgMhp0S

          Hopefully you guys can find the real cause

          Cuong Thai added a comment - - edited I have been around this issue for two days. Here is my configuration that is working at least 4 times continuously. Here is the log: http://pastebin.com/2fgMhp0S Hopefully you guys can find the real cause

          Thank you for your post Cuong.
          Android API 18 is running. I only have problems with API 19. I tested your configuration in different configurations e.g. without emulator options or without emulator executable, but nothing worked.

          I started 32 jobs. At 3 of them the device never appears in the log and one time jenkins had a problem to kill the adb server.
          https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/adb_crash

          Tobias Schumacher added a comment - Thank you for your post Cuong. Android API 18 is running. I only have problems with API 19. I tested your configuration in different configurations e.g. without emulator options or without emulator executable, but nothing worked. I started 32 jobs. At 3 of them the device never appears in the log and one time jenkins had a problem to kill the adb server. https://github.com/ITobiI/Android-Problem-Jenkins/blob/master/adb_crash

          Code changed in jenkins
          User: Richard Mortimer
          Path:
          src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java
          http://jenkins-ci.org/commit/android-emulator-plugin/3cbe81898db108f85dcb522bc09bea352667aa73
          Log:
          JENKINS-11952 Wait for ADB start to complete before starting the emulator

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java http://jenkins-ci.org/commit/android-emulator-plugin/3cbe81898db108f85dcb522bc09bea352667aa73 Log: JENKINS-11952 Wait for ADB start to complete before starting the emulator

          Code changed in jenkins
          User: Christopher Orr
          Path:
          src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java
          http://jenkins-ci.org/commit/android-emulator-plugin/f2fcd2f7d9c12cfd9b8de7cb3ae18049ef056db7
          Log:
          JENKINS-11952 Remove redundant (dis)connect calls while waiting for startup.

          These shouldn't be required, since emulators are now always started in the port
          range that adb automatically recognises.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java http://jenkins-ci.org/commit/android-emulator-plugin/f2fcd2f7d9c12cfd9b8de7cb3ae18049ef056db7 Log: JENKINS-11952 Remove redundant (dis)connect calls while waiting for startup. These shouldn't be required, since emulators are now always started in the port range that adb automatically recognises.

          Tobias Schumacher added a comment - - edited

          Hi. I still have this issue. Sometimes the emulator starts correctly. Can you add an option to choose, that the build will fail, if the emulator doesn't start (like a checkbox)?
          I would like to have this feature for the issues "error: device offline" and "error: device not found". I tried to repeat the build with naginator plugin but this is only working with a failed build job (or unstable).
          Or do you know any other way to repeat the build job?

          Thanks

          EDIT: I found the Text-finder plugin. I will work with it to change the job result to unstable. Then I can repeat the build with the naginator plugin.

          Tobias Schumacher added a comment - - edited Hi. I still have this issue. Sometimes the emulator starts correctly. Can you add an option to choose, that the build will fail, if the emulator doesn't start (like a checkbox)? I would like to have this feature for the issues "error: device offline" and "error: device not found". I tried to repeat the build with naginator plugin but this is only working with a failed build job (or unstable). Or do you know any other way to repeat the build job? Thanks EDIT: I found the Text-finder plugin. I will work with it to change the job result to unstable. Then I can repeat the build with the naginator plugin.

          I still have this issue too. Would you add adb connect timeout for workaround of this issue?

          Taiki Sugawara added a comment - I still have this issue too. Would you add adb connect timeout for workaround of this issue?

          Tobias Schumacher added a comment - - edited

          Taiki Sugawara: I'm using the text-finder and the naginator plugin. At the text-finder plugin, I search at the console output for the expression "Timed-out after waiting 720 seconds for emulator" (leave "Files" empty). If this expression was found then the build will be unstable (check the unstable if found checkbox).
          At the naginator plugin I checked the "Rerun build for unstable builds as well as failures" checkbox and I try again to run the job after 500 seconds (shorter is possible too). I configuered also that the build will be repeated 5 times.
          I hope this will help you with your problem.

          EDIT: At the naginator plugin you need to open the extended options and check "only rerun build if regular expression is found in output" and paste the time-out message into the "regular expression to search for" field. Without this the build will be repeated even the build is failing because of a source code error.

          @Richard Mortimer: Maybe you can add this workaround to your documentation.

          Tobias Schumacher added a comment - - edited Taiki Sugawara: I'm using the text-finder and the naginator plugin. At the text-finder plugin, I search at the console output for the expression "Timed-out after waiting 720 seconds for emulator" (leave "Files" empty). If this expression was found then the build will be unstable (check the unstable if found checkbox). At the naginator plugin I checked the "Rerun build for unstable builds as well as failures" checkbox and I try again to run the job after 500 seconds (shorter is possible too). I configuered also that the build will be repeated 5 times. I hope this will help you with your problem. EDIT: At the naginator plugin you need to open the extended options and check "only rerun build if regular expression is found in output" and paste the time-out message into the "regular expression to search for" field. Without this the build will be repeated even the build is failing because of a source code error. @Richard Mortimer: Maybe you can add this workaround to your documentation.

          I was just prompted to look at the connection code again and noticed that — contrary to what I wrote in my commit just above — we're not actually using the same port range that the emulator listens on and that adb checks for emulator-* instances.

          From double-checking the qemu and adb source, the port range should be 5554 to 5681 (the number of concurrent emulators was increased (though not 100% consistently throughout the code) from 16 to 64 a while ago).

          I wonder whether using this port range would help fix the adb amnesia problem where it somehow forgets devices (i.e. changes from "device offline" to "device not found". Perhaps if we use the "blessed" port range, adb will automatically re-connnect?

          Christopher Orr added a comment - I was just prompted to look at the connection code again and noticed that — contrary to what I wrote in my commit just above — we're not actually using the same port range that the emulator listens on and that adb checks for emulator-* instances. From double-checking the qemu and adb source, the port range should be 5554 to 5681 (the number of concurrent emulators was increased (though not 100% consistently throughout the code) from 16 to 64 a while ago). I wonder whether using this port range would help fix the adb amnesia problem where it somehow forgets devices (i.e. changes from "device offline" to "device not found" . Perhaps if we use the "blessed" port range, adb will automatically re-connnect?

          Though as ever, I can only rarely reproduce these issues, which makes testing ever-so-slightly difficult. Maybe I need to try it on a Mac or Windows?

          For anybody who has this issue, it would be nice to know what config is being used:

          • OS the Jenkins build is running on
          • Emulator config:
            • API level
            • screen resolution
            • target ABI
            • emulator options
            • emulator executable

          Christopher Orr added a comment - Though as ever, I can only rarely reproduce these issues, which makes testing ever-so-slightly difficult. Maybe I need to try it on a Mac or Windows? For anybody who has this issue, it would be nice to know what config is being used: OS the Jenkins build is running on Emulator config: API level screen resolution target ABI emulator options emulator executable

          Thierry-Dimitri Roy added a comment - - edited

          I can reproduce the problem rather easily. We run our tests continuously and we get connection error one fifth of the time.

          • OS the Jenkins build is running on: Mac OS X 10.8.5

          Logs:
          02:27:47 [android] Using Android SDK: /android/sdk/
          02:27:47 [android] Creating Android AVD: /Users/jenkins/workspace/replica_dev_stable/.android/avd/hudson_fr-CA_160_WXGA800_android-17_x86.avd
          02:27:47 [android] /android/sdk//tools/android create avd -f -a -c 1024M -s WXGA800 -n hudson_fr-CA_160_WXGA800_android-17_x86 -t android-17 --abi x86
          02:28:06 [android] Setting hardware properties:
          02:28:06 hw.gpu.enabled: yes
          02:28:06 hw.ramSize: 1907M
          02:28:06 vm.heapSize: 128
          02:28:06 hw.lcd.density: 160
          02:28:06 hw.dPad: yes
          02:28:06 hw.mainKeys: yes
          02:28:06 skin.dynamic: no
          02:28:06 skin.name: 1280x800
          02:28:06 skin.path: 1280x800
          02:28:06 $ /android/sdk//platform-tools/adb start-server
          02:28:09 * daemon not running. starting it now on port 5632 *
          02:28:09 * daemon started successfully *
          02:28:09 $ /android/sdk//platform-tools/adb start-server
          02:28:09 [android] Starting Android emulator
          02:28:09 $ /android/sdk//tools/emulator64-x86 -no-boot-anim -ports 5630,5631 -prop persist.sys.language=fr -prop persist.sys.country=CA -avd hudson_fr-CA_160_WXGA800_android-17_x86 -no-snapshot-load -no-snapshot-save -wipe-data
          02:28:14 HAX is working and emulator runs in fast virt mode
          02:28:15 emulator: emulator window was out of view and was recentered
          ...
          02:39:23 $ /android/sdk//platform-tools/adb -s emulator-5630 shell getprop dev.bootcomplete
          02:39:23 error: device not found
          02:39:37 $ /android/sdk//platform-tools/adb -s emulator-5630 shell getprop dev.bootcomplete
          02:39:37 error: device not found
          02:39:50 $ /android/sdk//platform-tools/adb -s emulator-5630 shell getprop dev.bootcomplete
          02:39:50 error: device not found
          02:40:04 $ /android/sdk//platform-tools/adb -s emulator-5630 shell getprop dev.bootcomplete
          02:40:04 error: device not found
          02:40:18 [android] Timed-out after waiting 720 seconds for emulator
          02:40:18 [android] Stopping Android emulator
          02:40:18 $ /android/sdk//platform-tools/adb kill-server


          Any suggestion? I'm more than willing to help you.
          ...


          [UPDATE] Here's a log with a connection that worked:

          06:11:12 $ /android/sdk//tools/android list target
          06:11:24 [android] Using Android SDK: /android/sdk/
          06:11:24 [android] Creating Android AVD: /Users/jenkins/workspace/replica_dev_stable/.android/avd/hudson_fr-CA_160_WXGA800_android-17_x86.avd
          06:11:24 [android] /android/sdk//tools/android create avd -f -a -c 1024M -s WXGA800 -n hudson_fr-CA_160_WXGA800_android-17_x86 -t android-17 --abi x86
          06:11:44 [android] Setting hardware properties:
          06:11:44 hw.gpu.enabled: yes
          06:11:44 hw.ramSize: 1907M
          06:11:44 vm.heapSize: 128
          06:11:44 hw.lcd.density: 160
          06:11:44 hw.dPad: yes
          06:11:44 hw.mainKeys: yes
          06:11:44 skin.dynamic: no
          06:11:44 skin.name: 1280x800
          06:11:44 skin.path: 1280x800
          06:11:44 $ /android/sdk//platform-tools/adb start-server
          06:11:47 * daemon not running. starting it now on port 5749 *
          06:11:47 * daemon started successfully *
          06:11:47 $ /android/sdk//platform-tools/adb start-server
          06:11:47 [android] Starting Android emulator
          06:11:47 $ /android/sdk//tools/emulator64-x86 -no-boot-anim -ports 5747,5748 -prop persist.sys.language=fr -prop persist.sys.country=CA -avd hudson_fr-CA_160_WXGA800_android-17_x86 -no-snapshot-load -no-snapshot-save -wipe-data
          06:11:53 HAX is working and emulator runs in fast virt mode
          06:11:54 emulator: emulator window was out of view and was recentered
          06:11:54
          06:11:55 $ /android/sdk//platform-tools/adb connect emulator-5747
          06:11:55 [android] Waiting for emulator to finish booting...
          06:11:55 $ /android/sdk//platform-tools/adb -s emulator-5747 shell getprop dev.bootcomplete
          06:11:55 error: device offline
          06:12:09 $ /android/sdk//platform-tools/adb -s emulator-5747 shell getprop dev.bootcomplete
          06:12:09 error: device offline
          06:12:22 $ /android/sdk//platform-tools/adb -s emulator-5747 shell getprop dev.bootcomplete
          06:12:22 $ /android/sdk//platform-tools/adb -s emulator-5747 logcat -v time
          06:12:22 [android] Emulator is ready for use (took 35 seconds)

          Thierry-Dimitri Roy added a comment - - edited I can reproduce the problem rather easily. We run our tests continuously and we get connection error one fifth of the time. OS the Jenkins build is running on: Mac OS X 10.8.5 Logs: 02:27:47 [android] Using Android SDK: /android/sdk/ 02:27:47 [android] Creating Android AVD: /Users/jenkins/workspace/replica_dev_stable/.android/avd/hudson_fr-CA_160_WXGA800_android-17_x86.avd 02:27:47 [android] /android/sdk//tools/android create avd -f -a -c 1024M -s WXGA800 -n hudson_fr-CA_160_WXGA800_android-17_x86 -t android-17 --abi x86 02:28:06 [android] Setting hardware properties: 02:28:06 hw.gpu.enabled: yes 02:28:06 hw.ramSize: 1907M 02:28:06 vm.heapSize: 128 02:28:06 hw.lcd.density: 160 02:28:06 hw.dPad: yes 02:28:06 hw.mainKeys: yes 02:28:06 skin.dynamic: no 02:28:06 skin.name: 1280x800 02:28:06 skin.path: 1280x800 02:28:06 $ /android/sdk//platform-tools/adb start-server 02:28:09 * daemon not running. starting it now on port 5632 * 02:28:09 * daemon started successfully * 02:28:09 $ /android/sdk//platform-tools/adb start-server 02:28:09 [android] Starting Android emulator 02:28:09 $ /android/sdk//tools/emulator64-x86 -no-boot-anim -ports 5630,5631 -prop persist.sys.language=fr -prop persist.sys.country=CA -avd hudson_fr-CA_160_WXGA800_android-17_x86 -no-snapshot-load -no-snapshot-save -wipe-data 02:28:14 HAX is working and emulator runs in fast virt mode 02:28:15 emulator: emulator window was out of view and was recentered ... 02:39:23 $ /android/sdk//platform-tools/adb -s emulator-5630 shell getprop dev.bootcomplete 02:39:23 error: device not found 02:39:37 $ /android/sdk//platform-tools/adb -s emulator-5630 shell getprop dev.bootcomplete 02:39:37 error: device not found 02:39:50 $ /android/sdk//platform-tools/adb -s emulator-5630 shell getprop dev.bootcomplete 02:39:50 error: device not found 02:40:04 $ /android/sdk//platform-tools/adb -s emulator-5630 shell getprop dev.bootcomplete 02:40:04 error: device not found 02:40:18 [android] Timed-out after waiting 720 seconds for emulator 02:40:18 [android] Stopping Android emulator 02:40:18 $ /android/sdk//platform-tools/adb kill-server — Any suggestion? I'm more than willing to help you. ... — [UPDATE] Here's a log with a connection that worked: 06:11:12 $ /android/sdk//tools/android list target 06:11:24 [android] Using Android SDK: /android/sdk/ 06:11:24 [android] Creating Android AVD: /Users/jenkins/workspace/replica_dev_stable/.android/avd/hudson_fr-CA_160_WXGA800_android-17_x86.avd 06:11:24 [android] /android/sdk//tools/android create avd -f -a -c 1024M -s WXGA800 -n hudson_fr-CA_160_WXGA800_android-17_x86 -t android-17 --abi x86 06:11:44 [android] Setting hardware properties: 06:11:44 hw.gpu.enabled: yes 06:11:44 hw.ramSize: 1907M 06:11:44 vm.heapSize: 128 06:11:44 hw.lcd.density: 160 06:11:44 hw.dPad: yes 06:11:44 hw.mainKeys: yes 06:11:44 skin.dynamic: no 06:11:44 skin.name: 1280x800 06:11:44 skin.path: 1280x800 06:11:44 $ /android/sdk//platform-tools/adb start-server 06:11:47 * daemon not running. starting it now on port 5749 * 06:11:47 * daemon started successfully * 06:11:47 $ /android/sdk//platform-tools/adb start-server 06:11:47 [android] Starting Android emulator 06:11:47 $ /android/sdk//tools/emulator64-x86 -no-boot-anim -ports 5747,5748 -prop persist.sys.language=fr -prop persist.sys.country=CA -avd hudson_fr-CA_160_WXGA800_android-17_x86 -no-snapshot-load -no-snapshot-save -wipe-data 06:11:53 HAX is working and emulator runs in fast virt mode 06:11:54 emulator: emulator window was out of view and was recentered 06:11:54 06:11:55 $ /android/sdk//platform-tools/adb connect emulator-5747 06:11:55 [android] Waiting for emulator to finish booting... 06:11:55 $ /android/sdk//platform-tools/adb -s emulator-5747 shell getprop dev.bootcomplete 06:11:55 error: device offline 06:12:09 $ /android/sdk//platform-tools/adb -s emulator-5747 shell getprop dev.bootcomplete 06:12:09 error: device offline 06:12:22 $ /android/sdk//platform-tools/adb -s emulator-5747 shell getprop dev.bootcomplete 06:12:22 $ /android/sdk//platform-tools/adb -s emulator-5747 logcat -v time 06:12:22 [android] Emulator is ready for use (took 35 seconds)

          Hi.

          Here's my configuration.

          Computer: Mac OS X 10.9.5

          Emulator:

          • API Level: android-18
          • screen density: 160
          • screen resolution: HVGA
          • targetabi: armeabi-v7a
          • emulator options:
          • emulator executable:
          • Delete emulator after build: checked
          • Startup delay: 20 seconds

          Android SDK Manager Revision: 23.0.5
          Android API 18:

          • SDK Platform Revision 3
          • Google API Revision 3

          Jenkins:

          • Version: 1.569
          • Android Emulator Plugin Version: 2.12 (official version from jenkins plugin management)

          Tobias Schumacher added a comment - Hi. Here's my configuration. Computer: Mac OS X 10.9.5 Emulator: API Level: android-18 screen density: 160 screen resolution: HVGA targetabi: armeabi-v7a emulator options: emulator executable: Delete emulator after build: checked Startup delay: 20 seconds Android SDK Manager Revision: 23.0.5 Android API 18: SDK Platform Revision 3 Google API Revision 3 Jenkins: Version: 1.569 Android Emulator Plugin Version: 2.12 (official version from jenkins plugin management)

          Thanks for the detailed info, Tobias (though your logs show x86, but your config ARMv7a?).

          I'll try these configs for myself, and I'll give it a go on a Mac.

          Christopher Orr added a comment - Thanks for the detailed info, Tobias (though your logs show x86, but your config ARMv7a?). I'll try these configs for myself, and I'll give it a go on a Mac.

          I can only find two files with the name x86 included at the project. At the build log at line 11 I create the emulator with "--abi armeabi-v7a".
          Maybe you looked at the log of Thierry-Dimitri Roy or did you look at this log?

          Tobias Schumacher added a comment - I can only find two files with the name x86 included at the project. At the build log at line 11 I create the emulator with "--abi armeabi-v7a". Maybe you looked at the log of Thierry-Dimitri Roy or did you look at this log?

          Oops, sorry, you're right! In that case, thanks Thierry for the detailed logs, and thank you for your detailed logs in the past and the info now

          How consistently do you see the failure-to-start problem?

          Christopher Orr added a comment - Oops, sorry, you're right! In that case, thanks Thierry for the detailed logs, and thank you for your detailed logs in the past and the info now How consistently do you see the failure-to-start problem?

          No problem.

          The problem occurs very different. From 10.12.14 (dd.mm.yy) until today I saw this problem 9 times at 48 builds. Sometimes the problem occurs 1 time in 2 weeks (14 builds) and then 6 times in 2 weeks (21 builds) (the build will be repeated automatically after the failure-to-start problem. these builds are included at tht build counter).

          Tobias Schumacher added a comment - No problem. The problem occurs very different. From 10.12.14 (dd.mm.yy) until today I saw this problem 9 times at 48 builds. Sometimes the problem occurs 1 time in 2 weeks (14 builds) and then 6 times in 2 weeks (21 builds) (the build will be repeated automatically after the failure-to-start problem. these builds are included at tht build counter).

          I was able to further analyze the problem. I saw the emulator running on port 5763 with the deamon running on the port 5764. But when I ran the command:

          adb -P 5764 devices

          It didn't list any devices.

          Then I tried connecting directly to the emulator with the command:

          adb -P 5764 connect localhost:5763

          It successfully connected! Then the 'devices' command showed the emulator. And running

          adb -P 5764 shell getprop init.svc.bootanim

          return the 'stopped' result. I have modified the jenkins plugin and I no longer see the timeout problem. I have created a pull request. Hope this help other people!

          Thierry-Dimitri Roy added a comment - I was able to further analyze the problem. I saw the emulator running on port 5763 with the deamon running on the port 5764. But when I ran the command: adb -P 5764 devices It didn't list any devices. Then I tried connecting directly to the emulator with the command: adb -P 5764 connect localhost:5763 It successfully connected! Then the 'devices' command showed the emulator. And running adb -P 5764 shell getprop init.svc.bootanim return the 'stopped' result. I have modified the jenkins plugin and I no longer see the timeout problem. I have created a pull request. Hope this help other people!

          Juan Sotuyo added a comment -

          I too see this with snapshots enabled (and existing, wiping the existing snapshot also works). Once I disabled snapshots it started working again.

          Juan Sotuyo added a comment - I too see this with snapshots enabled (and existing, wiping the existing snapshot also works). Once I disabled snapshots it started working again.

          Code changed in jenkins
          User: Christopher Orr
          Path:
          src/main/java/hudson/plugins/android_emulator/AndroidEmulatorContext.java
          http://jenkins-ci.org/commit/android-emulator-plugin/7949052acba9181ede1ecfed630b0059f113e9de
          Log:
          JENKINS-11952 Return to the "localhost:XXXX" style of connecting to emulators.

          For some reason, connecting to the emulator in this manner appears to be
          somwehat more reliable than connecting with the regular "emulator-XXXX" style.

          From the various JIRA issues opened against the most recent plugin releases,
          this instability seems to affect Mac OS X more than other operating systems.

          Now we use "localhost:XXXX", while sticking to a four-digit port number, as some
          tools seem to assume that the emulator port is always four-digits.

          While it's still a problem that ddmlib — as used by tools like the Maven Android
          plugin — only recognise emulators with the "emulator-XXXX" scheme, this should
          not be a problem, as the emulator itself at startup registers with adb in this
          style. While this means that running "adb devices" may show two connected
          devices (e.g. "emulator-5554" and "localhost:5555"), libraries like ddmlib will
          use the "emulator" variant, while build steps that call `adb` will automatically
          read the ANDROID_SERIAL environment vairable and use the "localhost" variant.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/AndroidEmulatorContext.java http://jenkins-ci.org/commit/android-emulator-plugin/7949052acba9181ede1ecfed630b0059f113e9de Log: JENKINS-11952 Return to the "localhost:XXXX" style of connecting to emulators. For some reason, connecting to the emulator in this manner appears to be somwehat more reliable than connecting with the regular "emulator-XXXX" style. From the various JIRA issues opened against the most recent plugin releases, this instability seems to affect Mac OS X more than other operating systems. Now we use "localhost:XXXX", while sticking to a four-digit port number, as some tools seem to assume that the emulator port is always four-digits. While it's still a problem that ddmlib — as used by tools like the Maven Android plugin — only recognise emulators with the "emulator-XXXX" scheme, this should not be a problem, as the emulator itself at startup registers with adb in this style. While this means that running "adb devices" may show two connected devices (e.g. "emulator-5554" and "localhost:5555"), libraries like ddmlib will use the "emulator" variant, while build steps that call `adb` will automatically read the ANDROID_SERIAL environment vairable and use the "localhost" variant.

          Code changed in jenkins
          User: Christopher Orr
          Path:
          src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java
          http://jenkins-ci.org/commit/android-emulator-plugin/5bdae99c654d40416a37af1bd3cca30f9db11543
          Log:
          Revert "JENKINS-11952 Remove redundant (dis)connect calls while waiting for startup."

          This reverts commit f2fcd2f7d9c12cfd9b8de7cb3ae18049ef056db7.

          This is required as, per the previous commit, we're using the "localhost" style
          of emulator connection string once again.

          Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/bd2fbec33e6f...5bdae99c654d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java http://jenkins-ci.org/commit/android-emulator-plugin/5bdae99c654d40416a37af1bd3cca30f9db11543 Log: Revert " JENKINS-11952 Remove redundant (dis)connect calls while waiting for startup." This reverts commit f2fcd2f7d9c12cfd9b8de7cb3ae18049ef056db7. This is required as, per the previous commit, we're using the "localhost" style of emulator connection string once again. Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/bd2fbec33e6f...5bdae99c654d

          So.. I switched back to the seemingly more reliable "localhost-XXXX" way of connecting to emulators, while also making sure we stick to four-digit port numbers for compatibility with (older) tools that depend on that.

          While I've often found these problems hard to reproduce, I've been doing lots of testing on a MacBook Pro, as Mac OS X seemed to be the OS worst affected by various "device offline" issues.

          The current code seems to work fairly reliably on OS X (and on Linux), and I've made a bunch of other improvements to the plugin recently. Everything tends to work pretty smoothly in my large test Jenkins jobs, where I set up a matrix of about ten different Android OS versions and get them to start up, and run an adb command.

          However, I still very often see unexplained failures on OS X when making the job do something useful, like installing an APK. I've tried running the jobs in serial, and disabling the background logcat thread (i.e. to minimise any disruptions to the emulator and adb), yet APK installation will either time out, or the adb connection will vanish.

          Anyway, it would be great if as many people as possible could test the latest build of the plugin.
          Download the ".hpi" file from the following link, then you can upload it to your Jenkins instance via the Plugin Manager > Advanced > Upload; you will then need to restart Jenkins:
          https://jenkins.ci.cloudbees.com/job/plugins/job/android-emulator-plugin/lastStableBuild/org.jenkins-ci.plugins$android-emulator/

          I would like to do a plugin release within the next week or so, though the Jenkins infrastructure for releasing is currently down (INFRA-240). All the more reason to get testing.

          Thanks, everyone.

          Christopher Orr added a comment - So.. I switched back to the seemingly more reliable "localhost-XXXX" way of connecting to emulators, while also making sure we stick to four-digit port numbers for compatibility with (older) tools that depend on that. While I've often found these problems hard to reproduce, I've been doing lots of testing on a MacBook Pro, as Mac OS X seemed to be the OS worst affected by various "device offline" issues. The current code seems to work fairly reliably on OS X (and on Linux), and I've made a bunch of other improvements to the plugin recently. Everything tends to work pretty smoothly in my large test Jenkins jobs, where I set up a matrix of about ten different Android OS versions and get them to start up, and run an adb command. However, I still very often see unexplained failures on OS X when making the job do something useful, like installing an APK. I've tried running the jobs in serial, and disabling the background logcat thread (i.e. to minimise any disruptions to the emulator and adb), yet APK installation will either time out, or the adb connection will vanish. Anyway, it would be great if as many people as possible could test the latest build of the plugin. Download the ".hpi" file from the following link, then you can upload it to your Jenkins instance via the Plugin Manager > Advanced > Upload; you will then need to restart Jenkins: https://jenkins.ci.cloudbees.com/job/plugins/job/android-emulator-plugin/lastStableBuild/org.jenkins-ci.plugins$android-emulator/ I would like to do a plugin release within the next week or so, though the Jenkins infrastructure for releasing is currently down (INFRA-240). All the more reason to get testing. Thanks, everyone.

          P Oh added a comment -

          Master server:
          ubuntu 14.04
          jenkins version 1.596

          slave:
          ubuntu 14.04
          java version "1.7.0_72"
          Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
          Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)
          android sdk tools 24.0.2
          android platform tools 21
          android sdk build-tools 21.1.2

          It seems to connect at some point but does not validate the connection correctly. Heres my semi-sanitized build log. Let me know where I can locate any other logs which may be of help.

          Started by upstream project "ad-pipeline" build number 36
          originally caused by:
          Started by an SCM change
          [EnvInject] - Loading node environment variables.
          Building remotely on android-slave (android) in workspace *****
          Cloning the remote Git repository
          Cloning repository *****
          > /usr/bin/git init ***** # timeout=10
          Fetching upstream changes from *****
          > /usr/bin/git --version # timeout=10
          using GIT_SSH to set credentials *****
          > /usr/bin/git -c core.askpass=true fetch --tags --progress ***** +refs/heads/:refs/remotes/origin/
          > /usr/bin/git config remote.origin.url ***** # timeout=10
          > /usr/bin/git config remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
          > /usr/bin/git config remote.origin.url ***** # timeout=10
          Fetching upstream changes from *****
          using GIT_SSH to set credentials *****
          > /usr/bin/git -c core.askpass=true fetch --tags --progress ***** +refs/heads/:refs/remotes/origin/
          > /usr/bin/git rev-parse refs/remotes/origin/develop^

          {commit} # timeout=10
          > /usr/bin/git rev-parse refs/remotes/origin/origin/develop^{commit}

          # timeout=10
          Checking out Revision ***** (refs/remotes/origin/develop)
          > /usr/bin/git config core.sparsecheckout # timeout=10
          > /usr/bin/git checkout -f *****
          > /usr/bin/git rev-list ***** # timeout=10
          Allocating TCP port AD_PIPELINE_INSTRUMENTATION_PORT
          -> Assigned 48374
          TCP port allocation complete
          $ /opt/android-sdk-linux/tools/android list target
          [android] Using Android SDK: /opt/android-sdk-linux
          [android] Creating Android AVD: *****/ad-pipeline-instrumentation/19/.android/avd/hudson_en-US_320_1080x1920_Google_Inc._Google_APIs_18_armeabi-v7a_jenkins.avd
          [android] /opt/android-sdk-linux/tools/android create avd -f -a -c 200M -s 1080x1920 -n hudson_en-US_320_1080x1920_Google_Inc._Google_APIs_18_armeabi-v7a_jenkins -t "Google Inc.:Google APIs:18" --abi armeabi-v7a
          [android] Waiting 10 seconds before starting emulator...
          $ /opt/android-sdk-linux/platform-tools/adb start-server

          • daemon not running. starting it now on port 7700 *
          • daemon started successfully *
            $ /opt/android-sdk-linux/platform-tools/adb start-server
            [android] Starting Android emulator
            $ /opt/android-sdk-linux/tools/emulator64-arm -no-boot-anim -ports 7698,7699 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_320_1080x1920_Google_Inc._Google_APIs_18_armeabi-v7a_jenkins -no-snapshot-load -no-snapshot-save -no-window -no-audio -gpu off
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            connected to localhost:7699
            [android] Waiting for emulator to finish booting...
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            error: device offline
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            error: device offline
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            error: device offline
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim
            $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699
            [android] Timed-out after waiting 720 seconds for emulator
            $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699
            [android] Stopping Android emulator
            Failed to open lib64EGL_translator
            Failed to init_egl_dispatch
            emulator: ERROR: OpenGLES initialization failed!
            emulator: ERROR: OpenGLES emulation library could not be initialized!
            emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
            $ /opt/android-sdk-linux/platform-tools/adb kill-server
            Finished: NOT_BUILT

          P Oh added a comment - Master server: ubuntu 14.04 jenkins version 1.596 slave: ubuntu 14.04 java version "1.7.0_72" Java(TM) SE Runtime Environment (build 1.7.0_72-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode) android sdk tools 24.0.2 android platform tools 21 android sdk build-tools 21.1.2 It seems to connect at some point but does not validate the connection correctly. Heres my semi-sanitized build log. Let me know where I can locate any other logs which may be of help. Started by upstream project "ad-pipeline" build number 36 originally caused by: Started by an SCM change [EnvInject] - Loading node environment variables. Building remotely on android-slave (android) in workspace ***** Cloning the remote Git repository Cloning repository ***** > /usr/bin/git init ***** # timeout=10 Fetching upstream changes from ***** > /usr/bin/git --version # timeout=10 using GIT_SSH to set credentials ***** > /usr/bin/git -c core.askpass=true fetch --tags --progress ***** +refs/heads/ :refs/remotes/origin/ > /usr/bin/git config remote.origin.url ***** # timeout=10 > /usr/bin/git config remote.origin.fetch +refs/heads/ :refs/remotes/origin/ # timeout=10 > /usr/bin/git config remote.origin.url ***** # timeout=10 Fetching upstream changes from ***** using GIT_SSH to set credentials ***** > /usr/bin/git -c core.askpass=true fetch --tags --progress ***** +refs/heads/ :refs/remotes/origin/ > /usr/bin/git rev-parse refs/remotes/origin/develop^ {commit} # timeout=10 > /usr/bin/git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10 Checking out Revision ***** (refs/remotes/origin/develop) > /usr/bin/git config core.sparsecheckout # timeout=10 > /usr/bin/git checkout -f ***** > /usr/bin/git rev-list ***** # timeout=10 Allocating TCP port AD_PIPELINE_INSTRUMENTATION_PORT -> Assigned 48374 TCP port allocation complete $ /opt/android-sdk-linux/tools/android list target [android] Using Android SDK: /opt/android-sdk-linux [android] Creating Android AVD: *****/ad-pipeline-instrumentation/19/.android/avd/hudson_en-US_320_1080x1920_Google_Inc._Google_APIs_18_armeabi-v7a_jenkins.avd [android] /opt/android-sdk-linux/tools/android create avd -f -a -c 200M -s 1080x1920 -n hudson_en-US_320_1080x1920_Google_Inc._Google_APIs_18_armeabi-v7a_jenkins -t "Google Inc.:Google APIs:18" --abi armeabi-v7a [android] Waiting 10 seconds before starting emulator... $ /opt/android-sdk-linux/platform-tools/adb start-server daemon not running. starting it now on port 7700 * daemon started successfully * $ /opt/android-sdk-linux/platform-tools/adb start-server [android] Starting Android emulator $ /opt/android-sdk-linux/tools/emulator64-arm -no-boot-anim -ports 7698,7699 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_320_1080x1920_Google_Inc._Google_APIs_18_armeabi-v7a_jenkins -no-snapshot-load -no-snapshot-save -no-window -no-audio -gpu off $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 connected to localhost:7699 [android] Waiting for emulator to finish booting... $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim error: device offline $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim error: device offline $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim error: device offline $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 $ /opt/android-sdk-linux/platform-tools/adb -s localhost:7699 shell getprop init.svc.bootanim $ /opt/android-sdk-linux/platform-tools/adb connect localhost:7699 [android] Timed-out after waiting 720 seconds for emulator $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:7699 [android] Stopping Android emulator Failed to open lib64EGL_translator Failed to init_egl_dispatch emulator: ERROR: OpenGLES initialization failed! emulator: ERROR: OpenGLES emulation library could not be initialized! emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. $ /opt/android-sdk-linux/platform-tools/adb kill-server Finished: NOT_BUILT

          P Oh added a comment -

          forgot to add, plugin version: 2.13-SNAPSHOT (private-5bdae99c-jenkins)

          P Oh added a comment - forgot to add, plugin version: 2.13-SNAPSHOT (private-5bdae99c-jenkins)

          akosmaroy added a comment -

          I have similar issues as reported by others:

          $ /Users/build/.jenkins/tools/android-sdk/platform-tools/adb -s emulator-5847 shell getprop dev.bootcomplete
          error: device offline
          

          installing the current snapshot HPI file manually seems to have solved the problem

          akosmaroy added a comment - I have similar issues as reported by others: $ /Users/build/.jenkins/tools/android-sdk/platform-tools/adb -s emulator-5847 shell getprop dev.bootcomplete error: device offline installing the current snapshot HPI file manually seems to have solved the problem

          I'm seeing the same thing, even with the latest snapshot plugin (2.13-SNAPSHOT (private-67377031-jenkins). In my case, I wouldn't say it's occasional - i'd say it's more like 90% of the time the emulator will fail to respond. 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.

          Here's an example of a sanitized log from a successful startup:
          ------------------------------------

          Deleting project workspace... Cloning the remote Git repository
          Cloning repository git@github.com:####/####.droid.git
          > git init /var/lib/jenkins/workspace/####.Droid-branches/instrumentation-test # timeout=10
          Fetching upstream changes from git@github.com:####/####.droid.git
          > git --version # timeout=10
          using GIT_SSH to set credentials
          > git -c core.askpass=true fetch --tags --progress git@github.com:####/####.droid.git +refs/heads/:refs/remotes/origin/
          > git config remote.origin.url git@github.com:####/####.droid.git # timeout=10
          > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
          > git config remote.origin.url git@github.com:####/####.droid.git # timeout=10
          Fetching upstream changes from git@github.com:####/####.droid.git
          using GIT_SSH to set credentials
          > git -c core.askpass=true fetch --tags --progress git@github.com:####/####.droid.git +refs/heads/:refs/remotes/origin/
          > git rev-parse origin/instrumentation-test^

          {commit} # timeout=10
          Checking out Revision #### (origin/instrumentation-test)
          > git config core.sparsecheckout # timeout=10
          > git checkout -f ####
          > git rev-list #### # timeout=10
          Starting xvnc
          [instrumentation-test] $ vncserver :63 -localhost -nolisten tcp

          New 'slave20150223:63 ()' desktop is slave20150223:63

          Starting applications specified in /var/lib/jenkins/.vnc/xstartup
          Log file is /var/lib/jenkins/.vnc/slave20150223:63.log

          $ /var/lib/jenkins/workspace/android-sdk/tools/android list target
          [android] Using Android SDK: /var/lib/jenkins/workspace/android-sdk
          [android] Creating Android AVD: /var/lib/jenkins/workspace/####.Droid-branches/instrumentation-test/.android/avd/hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation.avd
          [android] /var/lib/jenkins/workspace/android-sdk/tools/android create avd -f -a -s WVGA800 -n hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation -t android-19 --abi armeabi-v7a
          [android] Setting hardware properties:
          hw.audioInput: no
          [android] Waiting 10 seconds before starting emulator...
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb start-server
          * daemon not running. starting it now on port 9881 *
          * daemon started successfully *
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb start-server
          [android] Starting Android emulator
          $ /var/lib/jenkins/workspace/android-sdk/tools/emulator -no-boot-anim -ports 9879,9880 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation -no-snapshot-load -no-snapshot-save -no-audio -gpu off
          Failed to create Context 0x3005
          emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
          emulator: emulator window was out of view and was recentered

          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9880
          connected to localhost:9880
          [android] Waiting for emulator to finish booting...
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9880 shell getprop init.svc.bootanim
          error: device offline
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9880
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9880 shell getprop init.svc.bootanim
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9880 logcat -v time
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9880
          [android] Emulator is ready for use (took 20 seconds)
          [Gradle] - Launching build.
          [instrumentation-test] $ /var/lib/jenkins/tools/hudson.plugins.gradle.GradleInstallation/Gradle_2.2.1_####.Droid_/gradle-2.2.1/bin/gradle --debug --info --stacktrace assemble
          Starting Build

          ----------------------------


          And here's it failing:

          ----------------------------

          Deleting project workspace... done

          Cloning the remote Git repository
          Cloning repository git@github.com:####
          > git init /var/lib/jenkins/workspace/####.Droid-branches/instrumentation-test # timeout=10
          Fetching upstream changes from git@github.com:####/####.droid.git
          > git --version # timeout=10
          using GIT_SSH to set credentials
          > git -c core.askpass=true fetch --tags --progress git@github.com:####/####.droid.git +refs/heads/:refs/remotes/origin/
          > git config remote.origin.url git@github.com:####/####.droid.git # timeout=10
          > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
          > git config remote.origin.url git@github.com:####/####.droid.git # timeout=10
          Fetching upstream changes from git@github.com:####/####.droid.git
          using GIT_SSH to set credentials
          > git -c core.askpass=true fetch --tags --progress git@github.com:####/####.droid.git +refs/heads/:refs/remotes/origin/
          > git rev-parse origin/instrumentation-test^{commit}

          # timeout=10
          Checking out Revision #### (origin/instrumentation-test)
          > git config core.sparsecheckout # timeout=10
          > git checkout -f ####
          > git rev-list #### # timeout=10
          Starting xvnc
          [instrumentation-test] $ vncserver :95 -localhost -nolisten tcp

          New 'slave20150223:95 ()' desktop is slave20150223:95

          Starting applications specified in /var/lib/jenkins/.vnc/xstartup
          Log file is /var/lib/jenkins/.vnc/slave20150223:95.log

          $ /var/lib/jenkins/workspace/android-sdk/tools/android list target
          [android] Using Android SDK: /var/lib/jenkins/workspace/android-sdk
          [android] Creating Android AVD: /var/lib/jenkins/workspace/####.Droid-branches/instrumentation-test/.android/avd/hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation.avd
          [android] /var/lib/jenkins/workspace/android-sdk/tools/android create avd -f -a -s WVGA800 -n hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation -t android-19 --abi armeabi-v7a
          [android] Setting hardware properties:
          hw.audioInput: no
          [android] Waiting 10 seconds before starting emulator...

          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb start-server

          • daemon not running. starting it now on port 9227 *
          • daemon started successfully *
            $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb start-server
            [android] Starting Android emulator
            $ /var/lib/jenkins/workspace/android-sdk/tools/emulator -no-boot-anim -ports 9225,9226 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation -no-snapshot-load -no-snapshot-save -no-audio -gpu off

          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9226
          connected to localhost:9226
          [android] Waiting for emulator to finish booting...
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9226 shell getprop init.svc.bootanim
          error: device offline
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9226

          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9226 shell getprop init.svc.bootanim
          error: device offline
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9226

          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9226 shell getprop init.svc.bootanim
          error: device offline
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb disconnect localhost:9226
          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9226

          $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9226 shell getprop init.svc.bootanim
          error: device offline

          ------------

          In the failure case, it will sit there repeatedly cycling through the commands and the error: device offline until it times out and the job aborts.

          Nicholas Paufler added a comment - I'm seeing the same thing, even with the latest snapshot plugin (2.13-SNAPSHOT (private-67377031-jenkins). In my case, I wouldn't say it's occasional - i'd say it's more like 90% of the time the emulator will fail to respond. 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. Here's an example of a sanitized log from a successful startup: ------------------------------------ Deleting project workspace... Cloning the remote Git repository Cloning repository git@github.com:####/####.droid.git > git init /var/lib/jenkins/workspace/####.Droid-branches/instrumentation-test # timeout=10 Fetching upstream changes from git@github.com:####/####.droid.git > git --version # timeout=10 using GIT_SSH to set credentials > git -c core.askpass=true fetch --tags --progress git@github.com:####/####.droid.git +refs/heads/ :refs/remotes/origin/ > git config remote.origin.url git@github.com:####/####.droid.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/ :refs/remotes/origin/ # timeout=10 > git config remote.origin.url git@github.com:####/####.droid.git # timeout=10 Fetching upstream changes from git@github.com:####/####.droid.git using GIT_SSH to set credentials > git -c core.askpass=true fetch --tags --progress git@github.com:####/####.droid.git +refs/heads/ :refs/remotes/origin/ > git rev-parse origin/instrumentation-test^ {commit} # timeout=10 Checking out Revision #### (origin/instrumentation-test) > git config core.sparsecheckout # timeout=10 > git checkout -f #### > git rev-list #### # timeout=10 Starting xvnc [instrumentation-test] $ vncserver :63 -localhost -nolisten tcp New 'slave20150223:63 ()' desktop is slave20150223:63 Starting applications specified in /var/lib/jenkins/.vnc/xstartup Log file is /var/lib/jenkins/.vnc/slave20150223:63.log $ /var/lib/jenkins/workspace/android-sdk/tools/android list target [android] Using Android SDK: /var/lib/jenkins/workspace/android-sdk [android] Creating Android AVD: /var/lib/jenkins/workspace/####.Droid-branches/instrumentation-test/.android/avd/hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation.avd [android] /var/lib/jenkins/workspace/android-sdk/tools/android create avd -f -a -s WVGA800 -n hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation -t android-19 --abi armeabi-v7a [android] Setting hardware properties: hw.audioInput: no [android] Waiting 10 seconds before starting emulator... $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb start-server * daemon not running. starting it now on port 9881 * * daemon started successfully * $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb start-server [android] Starting Android emulator $ /var/lib/jenkins/workspace/android-sdk/tools/emulator -no-boot-anim -ports 9879,9880 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation -no-snapshot-load -no-snapshot-save -no-audio -gpu off Failed to create Context 0x3005 emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. emulator: emulator window was out of view and was recentered $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9880 connected to localhost:9880 [android] Waiting for emulator to finish booting... $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9880 shell getprop init.svc.bootanim error: device offline $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9880 $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9880 shell getprop init.svc.bootanim $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9880 logcat -v time $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9880 [android] Emulator is ready for use (took 20 seconds) [Gradle] - Launching build. [instrumentation-test] $ /var/lib/jenkins/tools/hudson.plugins.gradle.GradleInstallation/Gradle_2.2.1_####.Droid_/gradle-2.2.1/bin/gradle --debug --info --stacktrace assemble Starting Build ---------------------------- And here's it failing: ---------------------------- Deleting project workspace... done Cloning the remote Git repository Cloning repository git@github.com:#### > git init /var/lib/jenkins/workspace/####.Droid-branches/instrumentation-test # timeout=10 Fetching upstream changes from git@github.com:####/####.droid.git > git --version # timeout=10 using GIT_SSH to set credentials > git -c core.askpass=true fetch --tags --progress git@github.com:####/####.droid.git +refs/heads/ :refs/remotes/origin/ > git config remote.origin.url git@github.com:####/####.droid.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/ :refs/remotes/origin/ # timeout=10 > git config remote.origin.url git@github.com:####/####.droid.git # timeout=10 Fetching upstream changes from git@github.com:####/####.droid.git using GIT_SSH to set credentials > git -c core.askpass=true fetch --tags --progress git@github.com:####/####.droid.git +refs/heads/ :refs/remotes/origin/ > git rev-parse origin/instrumentation-test^{commit} # timeout=10 Checking out Revision #### (origin/instrumentation-test) > git config core.sparsecheckout # timeout=10 > git checkout -f #### > git rev-list #### # timeout=10 Starting xvnc [instrumentation-test] $ vncserver :95 -localhost -nolisten tcp New 'slave20150223:95 ()' desktop is slave20150223:95 Starting applications specified in /var/lib/jenkins/.vnc/xstartup Log file is /var/lib/jenkins/.vnc/slave20150223:95.log $ /var/lib/jenkins/workspace/android-sdk/tools/android list target [android] Using Android SDK: /var/lib/jenkins/workspace/android-sdk [android] Creating Android AVD: /var/lib/jenkins/workspace/####.Droid-branches/instrumentation-test/.android/avd/hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation.avd [android] /var/lib/jenkins/workspace/android-sdk/tools/android create avd -f -a -s WVGA800 -n hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation -t android-19 --abi armeabi-v7a [android] Setting hardware properties: hw.audioInput: no [android] Waiting 10 seconds before starting emulator... $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb start-server daemon not running. starting it now on port 9227 * daemon started successfully * $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb start-server [android] Starting Android emulator $ /var/lib/jenkins/workspace/android-sdk/tools/emulator -no-boot-anim -ports 9225,9226 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_android-19_armeabi-v7a_instrumentation -no-snapshot-load -no-snapshot-save -no-audio -gpu off $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9226 connected to localhost:9226 [android] Waiting for emulator to finish booting... $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9226 shell getprop init.svc.bootanim error: device offline $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9226 $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9226 shell getprop init.svc.bootanim error: device offline $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9226 $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9226 shell getprop init.svc.bootanim error: device offline $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb disconnect localhost:9226 $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb connect localhost:9226 $ /var/lib/jenkins/workspace/android-sdk/platform-tools/adb -s localhost:9226 shell getprop init.svc.bootanim error: device offline ------------ In the failure case, it will sit there repeatedly cycling through the commands and the error: device offline until it times out and the job aborts.

          Erik Ingman added a comment -

          We have solved this on our end, it seems to work every time. According to the Android Emulator docs "The console port number must be an even integer between 5554 and 5584, inclusive. <port>+1 must also be free and will be reserved for ADB." So we've created a PR, see https://github.com/jenkinsci/android-emulator-plugin/pull/48

          /Erik @ www.blocket.se

          Erik Ingman added a comment - We have solved this on our end, it seems to work every time. According to the Android Emulator docs "The console port number must be an even integer between 5554 and 5584, inclusive. <port>+1 must also be free and will be reserved for ADB." So we've created a PR, see https://github.com/jenkinsci/android-emulator-plugin/pull/48 /Erik @ www.blocket.se

          pipen: I tried this change a month or so ago after somebody mentioned that documentation to me, but I found that it made no difference.

          From re-reading the Android source code, I couldn't see any obvious technical reason why the ports have to be in that form (and only the "-port" flag, not "-ports" enforces it anyway), the "maximum" port number hasn't been 5584 for a long time, adb does recognise emulators started on high ports, and I also looked through lots of build logs for evidence that the user port being even and in that range makes a difference — I didn't find anything conclusive (in fact, emulator startup was more likely to fail in that case).

          In addition, the code in this pull request doesn't guarantee that the first port will be even, so I'll have to be skeptical about your claims
          But if it turns out that this change nevertheless helps, then that's good to know. So what are the results you are seeing? Which OS are the emulator builds running on, and what is the emulator config? How many builds were failing previously, compared to now, and is that with builds whose user port is actually even?

          Christopher Orr added a comment - pipen : I tried this change a month or so ago after somebody mentioned that documentation to me, but I found that it made no difference. From re-reading the Android source code, I couldn't see any obvious technical reason why the ports have to be in that form (and only the "-port" flag, not "-ports" enforces it anyway), the "maximum" port number hasn't been 5584 for a long time, adb does recognise emulators started on high ports, and I also looked through lots of build logs for evidence that the user port being even and in that range makes a difference — I didn't find anything conclusive (in fact, emulator startup was more likely to fail in that case). In addition, the code in this pull request doesn't guarantee that the first port will be even, so I'll have to be skeptical about your claims But if it turns out that this change nevertheless helps, then that's good to know. So what are the results you are seeing? Which OS are the emulator builds running on, and what is the emulator config? How many builds were failing previously, compared to now, and is that with builds whose user port is actually even?

          Joe Hansche added a comment -

          I tend to agree with orrc. Out of the last ~7 builds that were attempted, these were the results:

          • -ports 5743,5744 – Worked
          • -ports 5849,5850 – Failed to start
          • -ports 5705,5706 – Failed to start
          • -ports 5886,5887 – Worked
          • -ports 5719,5720 – Worked
          • -ports 5619,5620 – Failed to start
          • -ports 5866,5867 – Worked
          • -ports 5822,5823 – Worked

          So this means it does not seem to be affected by the even/odd pairs.

          Joe Hansche added a comment - I tend to agree with orrc . Out of the last ~7 builds that were attempted, these were the results: -ports 5743,5744 – Worked -ports 5849,5850 – Failed to start -ports 5705,5706 – Failed to start -ports 5886,5887 – Worked -ports 5719,5720 – Worked -ports 5619,5620 – Failed to start -ports 5866,5867 – Worked -ports 5822,5823 – Worked So this means it does not seem to be affected by the even/odd pairs.

          Version 2.13 of the plugin has been released, which includes the updates discussed here.

          Christopher Orr added a comment - Version 2.13 of the plugin has been released, which includes the updates discussed here.

          I'm marking this issue as closed, though I'm aware of the likelihood that not everything is working brilliantly on every machine, all the time.

          But if there are still obvious issues in 2.13, let's please open a clean issue.

          Christopher Orr added a comment - I'm marking this issue as closed, though I'm aware of the likelihood that not everything is working brilliantly on every machine, all the time. But if there are still obvious issues in 2.13, let's please open a clean issue.

          Andy Piper added a comment -

          This does not work.

          andypiper:platform-tools andy$ ./adb -s localhost:5554 shell getprop init.svc.bootanim
          error: device 'localhost:5554' not found

          Maybe something changed in the latest releases of android, but this mechanism is now invalid as a means of connecting to the emulator

          Andy Piper added a comment - This does not work. andypiper:platform-tools andy$ ./adb -s localhost:5554 shell getprop init.svc.bootanim error: device 'localhost:5554' not found Maybe something changed in the latest releases of android, but this mechanism is now invalid as a means of connecting to the emulator

          Andy Piper added a comment -

          Does not work on current android releases.

          Android Debug Bridge version 1.0.32
          Revision 57224c5cff69-android

          Andy Piper added a comment - Does not work on current android releases. Android Debug Bridge version 1.0.32 Revision 57224c5cff69-android

            Unassigned Unassigned
            jorgenpt Jørgen Tjernø
            Votes:
            10 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated: