I have Jenkins
1.568 installed on a Macbook Air
running Ubuntu 14.04
. I have the android emulator plugin installed, and the configuration I have set up runs the emulator in -no-window
mode before starting each build.
About half of the builds are fine, but the other half, I get the following on the console:
[android] Starting Android emulator
$ /usr/local/src/android/android-sdk-linux/tools/emulator -no-boot-anim -ports 5782,5783 -avd Caesar -no-snapshot-load -no-snapshot-save -no-window -no-audio -no-skin -no-window
* daemon not running. starting it now on port 5784 *
* daemon started successfully *
Failed to Initialize backend EGL display
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
[android] Waiting for emulator to finish booting...
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb -s emulator-5782 shell getprop dev.bootcomplete
error: device offline
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb connect emulator-5782
[android] Timed-out after waiting 360 seconds for emulator
$ /usr/local/src/android/android-sdk-linux/platform-tools/adb disconnect emulator-5782
[android] Stopping Android emulator
Clearly, the emulator is failing about 50% of the time. I'm not sure why, though, or how to fix it. Any suggestions would be welcome as to how I can get this running and not have to restart failed builds using naginator.
If the Android Emulator does not start properly, this problem is often caused by problems with HAXM. HAXM issues are often the result of conflicts with other virtualization technologies, incorrect settings, or an out-of-date HAXM driver. Try reinstalling the HAXM driver, using the steps detailed in Installing HAXM.
If the emulator fails to launch due to the error vulkan-1. dll cannot be found , you probably need to update the emulator. To update the emulator in Android Studio, go to Tools > SDK Manager and install the latest stable version of Android platform.
Start the Android SDK Manager (select Start | All Programs | Embarcadero RAD Studio | Android Tools). In the Android SDK Manager, click the Tools menu and select Manage AVDs. In the Android Virtual Device Manager, select the emulator and click Start. Then click Launch on the Launch Options dialog box.
Open the Preferences window by clicking File > Settings (on Mac, Android Studio > Preferences). In the left panel, click Appearance & Behavior > System Settings > Updates. Be sure that Automatically check for updates is checked, then select a channel from the drop-down list (see figure 1). Click Apply or OK.
Try to update Java. I had android emulator problems in the past and a Java update fixed them.
Timeout problems.
DdmPreferences.setTimeOut is the global adb read/write packet timeout setting. In 'at com.android.ddmlib.SyncService.doPushFile(SyncService.java:671)', DdmPreferences.getTimeOut() is called and used to set timeout.
In build.gradle:
android{
...
adbOptions {
timeOutInMs 10 * 60 * 1000 // 10 minutes
}
}
For Eclipse (Preferences -> Android -> DDMS).
Also, this is an environment variable that you set outside of build.gradle. On Ubuntu for instance:
$ export ADB_INSTALL_TIMEOUT=5
$ ./gradlew installDebug
Between runs:
sudo adb kill-server
and
sudo adb start-server
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With