多配置矩阵作业无法启动模拟器并出现一些错误

时间:2019-02-22 10:50:22

标签: android jenkins multi-configuration

我正在创建一个多配置矩阵作业,以在Jenkins上的多个仿真器上运行测试,但是失败了,仿真器无法启动。以下是工作中的控制台输出:

Building in workspace /Users/mobile_team/.jenkins/multiConfigTestJob/density=480,os=android-28,resolution=1080x1920-13/density/480/os/android-28/resolution/1080x1920
$ /Users/mobile_team/Library/Android/sdk/tools/bin/avdmanager list target
$ /Users/mobile_team/Library/Android/sdk/tools/bin/sdkmanager --list --verbose
Warning: File /Users/mobile_team/.jenkins/multiConfigTestJob/density=480,os=android-28,resolution=1080x1920-13/density/480/os/android-28/resolution/1080x1920/.android/repositories.cfg could not be loaded.
[android] Using Android SDK: /Users/mobile_team/Library/Android/sdk
[android] Creating Android AVD: /Users/mobile_team/.jenkins/multiConfigTestJob/density=480,os=android-28,resolution=1080x1920-13/density/480/os/android-28/resolution/1080x1920/.android/avd/hudson_en-US_480_1080x1920_android-28_google_apis-x86_multiConfigTestJob-density-480-os-android-28-resolution-1080x1920---13.avd
[android] /Users/mobile_team/Library/Android/sdk/tools/bin/avdmanager create avd -f -c 512M -n hudson_en-US_480_1080x1920_android-28_google_apis-x86_multiConfigTestJob-density-480-os-android-28-resolution-1080x1920---13 -k system-images;android-28;google_apis;x86 --tag google_apis
    Loading local repository...                                                     
    [=========                              ] 25% Loading local repository...       
    [=========                              ] 25% Fetch remote repository...        
    [=========                              ] 25% Fetch remote repository...        
    [=========                              ] 25% Fetch remote repository...        
    [=======================================] 100% Fetch remote repository...       
    Auto-selecting single ABI x86
    Do you wish to create a custom hardware profile? [no] 
$ /Users/mobile_team/Library/Android/sdk/platform-tools/adb start-server
* daemon not running; starting now at tcp:5841
* daemon started successfully
$ /Users/mobile_team/Library/Android/sdk/platform-tools/adb start-server
[android] Starting Android emulator
$ /Users/mobile_team/Library/Android/sdk/emulator/emulator -skin 1080x1920 -ports 5696,5697 -report-console tcp:5845,max=60 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_480_1080x1920_android-28_google_apis-x86_multiConfigTestJob-density-480-os-android-28-resolution-1080x1920---13 -wipe-data -noaudio
Refreshing RAM file (size mismatch): existing 0 curr 1610612736
emulator: WARNING: cannot read adb public key file: /Users/mobile_team/.jenkins/multiConfigTestJob/density=480,os=android-28,resolution=1080x1920-13/density/480/os/android-28/resolution/1080x1920/.android/adbkey.pub
qemu-system-x86_64: -drive if=none,index=1,id=cache,file=/Users/mobile_team/.jenkins/multiConfigTestJob/density=480,os=android-28,resolution=1080x1920-13/density/480/os/android-28/resolution/1080x1920/.android/avd/hudson_en-US_480_1080x1920_android-28_google_apis-x86_multiConfigTestJob-density-480-os-android-28-resolution-1080x1920---13.avd/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576: Could not open '/Users/mobile_team/.jenkins/multiConfigTestJob/density=480': No such file or directory
[android] Emulator did not appear to start; giving up
[android] Stopping Android emulator
$ /Users/mobile_team/Library/Android/sdk/platform-tools/adb kill-server
Performing Post build task...
Match found for : : True
Logical operation result is TRUE
Skipping post build task 0 - job status is worse than unstable : NOT_BUILT
Archiving artifacts
Finished: NOT_BUILT

此时卡住了,不确定是什么原因导致了故障...请帮助!

1 个答案:

答案 0 :(得分:0)

为他人解答问题。我想通了,但忘了回答。 之所以发生这种情况是因为Jenkins在Manage Jenkins > Configure System下的配置选项中有一个选项--Keep emulators in the job workspace, in the .android subdirectory, to isolate them as much as possible。 如果我们保持选中状态,则使用多配置矩阵的作业会发生此错误。

enter image description here

希望这会有所帮助!