title: Android emulator failed to start after 360 seconds
body: <p>I have <code>Jenkins</code> 1.568 installed on a <code>Macbook Air</code> running <code>Ubuntu 14.04</code>. I have the android emulator plugin installed, and the configuration I have set up runs the emulator in <code>-no-window</code> mode before starting each build. </p>
  
  <p>About half of the builds are fine, but the other half, I get the following on the console:</p>
  
  <pre><code>[android] Starting Android emulator
  $ /usr/local/src/android/android-sdk-linux/tools/emulator -no-boot-anim -ports 5782,5783 -avd Caesar -no-snapshot-load -no-snapshot-save -no-window -no-audio -no-skin -no-window
  * daemon not running. starting it now on port 5784 *
  * daemon started successfully *
  Failed to Initialize backend EGL display
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  [android] Waiting for emulator to finish booting...
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
  error: device offline
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
  [android] Timed-out after waiting 360 seconds for emulator
  $ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
  [android] Stopping Android emulator
  </code></pre>
  
  <p>Clearly, the emulator is failing about 50% of the time. I'm not sure why, though, or how to fix it. Any suggestions would be welcome as to how I can get this running and not have to restart failed builds using naginator.</p>