在debian上用jenkins运行android模拟器无头

时间:2015-04-13 16:15:06

标签: jenkins debian kvm headless avd

我想通过无头debian上的jenkins任务在模拟器中运行espresso测试。我还用它来截取发布截图。

Jenkins构建失败并显示以下消息:

$ /opt/android-sdk-linux/tools/android list target
[android] Using Android SDK: /opt/android-sdk-linux
[android] Setting hardware properties:
    hw.ramSize: 1536
    vm.heapSize: 128
    hw.gpu.enabled: yes
$ /opt/android-sdk-linux/platform-tools/adb start-server
* daemon not running. starting it now on port 5826 *
* daemon started successfully *
$ /opt/android-sdk-linux/platform-tools/adb start-server
[android] Starting Android emulator
$ /opt/android-sdk-linux/tools/emulator -ports 5824,5825 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_480_1920x1080_Google_Inc._Google_APIs_22_google_apis-x86_64 -no-snapshot-load -no-snapshot-save -no-window
emulator: WARNING: Host CPU is missing the following feature(s) required for x86_64 emulation: SSE4.1 SSE4.2 POPCNT
Hardware-accelerated emulation may not work properly!
[android] Emulator did not appear to start; giving up
$ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:5825
[android] Stopping Android emulator
$ /opt/android-sdk-linux/platform-tools/adb kill-server
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /var/lib/jenkins/workspace/PublishCupido/PingAndroidClient/build/spoon/release to /var/lib/jenkins/jobs/PublishCupido/htmlreports/Screenshots
Finished: NOT_BUILT

我认为这是由于模拟速度很慢造成的超时造成的。

当我通过命令行启动模拟器时,我看到:

/opt/android-sdk-linux/tools/emulator -ports 8196,8197 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_480_1920x1080_Google_Inc._Google_APIs_22_google_apis-x86_64 -no-snapshot-load -no-snapshot-save -no-window -show-kernel
emulator: WARNING: Host CPU is missing the following feature(s) required for x86_64 emulation: SSE4.1 SSE4.2 POPCNT
Hardware-accelerated emulation may not work properly!
Failed to open lib64EGL_translator
Failed to init_egl_dispatch
emulator: ERROR: OpenGLES initialization failed!
emulator: ERROR: OpenGLES emulation library could not be initialized!
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
Killed

我对丢失的CPU功能做不了多少,可以吗???

但是应该可以让GPU运行。

# ldconfig -lv /opt/android-sdk-linux/tools/lib/lib64EGL_translator.so 
    lib64EGL_translator.so -> lib64EGL_translator.so
# ldconfig -p | grep lib64
    lib64EGL_translator.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/lib64EGL_translator.so

但:

# ldconfig -v | grep lib64
ldconfig: Can't stat /lib/i486-linux-gnu: No such file or directory
ldconfig: Can't stat /usr/lib/i486-linux-gnu: No such file or directory
ldconfig: Path `/lib/x86_64-linux-gnu' given more than once
ldconfig: Path `/usr/lib/x86_64-linux-gnu' given more than once
ldconfig: /lib/i386-linux-gnu/ld-2.13.so is the dynamic linker, ignoring

ldconfig: /lib/x86_64-linux-gnu/ld-2.13.so is the dynamic linker, ignoring

手动创建链接不会改变任何内容:

# ln -s /opt/android-sdk-linux/tools/lib/lib64EGL_translator.so /usr/lib/x86_64-linux-gnu/
# ldconfig
  1. 我的CPU是否为KVM旧版?
  2. 我如何提供遗失的图书馆?
  3. 我还能做些什么来加速模拟?
  4. 如何增加/避免超时?
  5. 使用jenkins模拟器还能做些什么?
  6. THX

0 个答案:

没有答案