2014-06-27 89 views
13

我在運行Ubuntu 14.04的Macbook Air上安裝了Jenkins 1.568。我安裝了android模擬器插件,並且我已經設置的配置在開始每個構建之前在-no-window模式下運行模擬器。Android仿真器在360秒後未能啓動

關於該版本的一半都很好,但另一半,我得到的控制檯上執行以下操作:

[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 

顯然,仿真器出現故障的時間約50%。我不知道爲什麼,或者如何解決它。任何建議都會受到歡迎,我可以如何運行,而不必使用naginator重新啓動失敗的版本。

+3

你解決了這個問題嗎?我面對完全相同 –

+0

不,對不起佩德羅。我還沒有解決這個問題。我仍在等待答案。與此同時,如果失敗,我再次運行構建(最多可以嘗試5次),從而緩解了這一問題。不是一個最佳的解決方案,但更好的方法是讓它失敗並保持失敗。 – jwir3

+0

謝謝,我一直在尋找一個解決方案,但沒有發現任何東西,所以我有一個java測試版本,用於模塊化的東西,它不依賴於模擬器,另一個工作僅用於測試,我在那裏發佈時間是必要的。所以現在我已經從jenkins下載了我的發佈版本,唯一不好的是所有依賴於仿真器的測試用例都必須在不同的工作中啓動。如果我找到解決方案,我會發布它! –

回答

-1

我剛剛找到解決方案Android Emulator Plugin Failed to Initialize backend EGL display

比較你的工作與配置https://partnerdemo.ci.cloudbees.com/job/Android-dev/job/stockfish-android-cloud/,要特別注意以下設置:

Inject env var: LD_LIBRARY_PATH=/opt/android/android-sdk-linux/tool/lib 
Target ABI: armeabi-v7a 
Advanced -> Emulator Options: -no-audio -gpu off 
Advanced -> Emulator Executable: emulator64-arm 

我希望它可以幫助你。

+0

這個答案已經在不同的問題上。配置鏈接不起作用。我的配置沒有看到任何問題。它調用模擬器,但無法啓動emulatore – Libin

0

嘗試更新Java。過去我有過Android模擬器問題,Java更新解決了它們。

0

超時問題。

DdmPreferences.setTimeOut是全局adb讀/寫數據包超時設置。 在'at com.android.ddmlib.SyncService.doPushFile(SyncService.java:671)'中,調用DdmPreferences.getTimeOut()並用於設置超時。

在的build.gradle:

android{ 
... 
    adbOptions { 
     timeOutInMs 10 * 60 * 1000 // 10 minutes 
    } 
} 

對於Eclipse(首選項 - >的Android - > DDMS)。

另外,這是一個您在build.gradle之外設置的環境變量。在Ubuntu例如:

$ export ADB_INSTALL_TIMEOUT=5 
$ ./gradlew installDebug 

運行之間:

須藤ADB殺服務器

須藤亞行啓動服務器

0

下面是一個清單,以幫助:

1)你需要--all標誌同時在Android清單和Android SDK的更新,否則一些包將不會安裝:對於SDK 24

1A)$ ANDROID_HOME /工具/ Android的SDK名單--all

1B EX)

(for i in {1..100}; do echo y; sleep 1; done) | 
$ANDROID_HOME/tools/android update sdk --no-ui --all --filter 
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,24,25,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81,82,82,84,85,101,102,103,112,113,117,118,119,120,121,122,123,124 

,如果你得到了可怕的/ home /詹金斯/ Android的SDK-LINUX /平臺工具/ ADB -s模擬器-XXXX殼getprop開發。bootcomplete錯誤:設備離線的錯誤,你很可能在步驟缺一包1B

2)忽略了可怕的初始化失敗後端EGL顯示錯誤,它是一個紅色的鯡魚

3)一定要使用高級仿真器選項:

Emulator Options: -no-audio -gpu off 
Emulator executable: emulator64-arm 
Startup delay: 10 -- this *may* help 

4)構建前腳本${ANDROID_HOME}/platform-tools/adb kill-server不能傷害 退房詹金斯網站https://issues.jenkins-ci.org/browse/JENKINS-27456 https://issues.jenkins-ci.org/browse/JENKINS-11952 您還可以檢查這一項https://code.google.com/p/android/issues/detail?id=209955http://www.yzjingying.net/4855150152.htm 祝你好運!