我有一臺運行Jenkins CI 2.7.4的Mac Mini服務器,並且已經創建了一個工作來構建我的Android項目。該工作還通過Android模擬器插件運行模擬器以運行一些Espresso測試。但是,我遇到了模擬器從未真正啓動的問題。我選中了「顯示模擬器窗口」選項。Jenkins CI - Android模擬器無法啓動
下面是輸出:
[android] Using Android SDK: /Users/Shared/Jenkins/Home/tools/android-sdk
[android] Adding 128M SD card to AVD 'hudson_en-US_120_WXGA720_android-23_x86'...
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb start-server
* daemon not running. starting it now on port 5832 *
* daemon started successfully *
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb start-server
$ /Users/Shared/Jenkins/Home/tools/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_120_WXGA720_android-23_x86
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
WARNING: Force to use classic engine to support snapshot.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
[android] Starting Android emulator and creating initial snapshot
[android] Erasing existing emulator data...
$ /Users/Shared/Jenkins/Home/tools/android-sdk/tools/emulator -engine classic -ports 5730,5731 -report-console tcp:5852,max=60 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_120_WXGA720_android-23_x86 -no-snapshot-load -no-snapshot-save -wipe-data
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
WARNING: Force to use classic engine to support snapshot.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
2016-09-27 14:31:02.344 emulator64-x86[981:7440] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
PasteBoard: Error creating pasteboard: com.apple.pasteboard.clipboard [-4960]
2016-09-27 14:31:02.344 emulator64-x86[981:7440] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
PasteBoard: Error creating pasteboard: com.apple.pasteboard.find [-4960]
no screens available, assuming 24-bit color
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextSetFillColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextFillRects: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
QPaintDevice::metrics: Device has no metric information
QPaintDevice::metrics: Device has no metric information
QPaintDevice::metrics: Device has no metric information
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextConcatCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Sep 27 14:31:02 emulator64-x86[981] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Cannot create window: no screens available
emulator: WARNING: Classic qemu does not support SMP. The hw.cpu.ncore option from your config file is ignored.
[android] Emulator did not appear to start; giving up
[android] Stopping Android emulator
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb kill-server
Finished: NOT_BUILT
我得到一個超時錯誤,如果我選中 「顯示仿真器窗口」:
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5752 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is 'running'
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5752 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is 'running'
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5752 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is 'running'
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5752 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is 'running'
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5752 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is 'running'
[android] Timed-out after waiting 360 seconds for emulator
[android] Stopping Android emulator
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb kill-server
Finished: NOT_BUILT
貌似你試圖運行模擬器無頭,即不是在登錄界面會?它沒有「顯示模擬器窗口」工作嗎? –