Jenkins Android Emulator插件未运行

时间:2017-06-28 13:04:53

标签: jenkins android-emulator jenkins-plugins

我正在尝试探索并使用Jenkins Android Emulator插件,以便在CI环境中运行我的模拟器。到目前为止,我尝试了3种不同的方法,但没有一种能够运行模拟器

方法1:使用现有模拟器

Screenshot of the first method

在作业的配置中,选择 在构建期间运行Android模拟器 ,然后选择 运行现有模拟器 。在 AVD名称 中,我插入了Nexus5X_6_8664,然后Jenkins就能找到它。

当我运行该作业时,它会给我以下错误:

Started by user Amine
Building in workspace D:\jenkins\workspace\Emulator
[android] Using Android SDK: D:\Tools\Dev\sdk\
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe start-server
* daemon not running. starting it now at tcp:5857 *
* daemon started successfully *
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe start-server
[android] Starting Android emulator
$ D:\Tools\Dev\sdk\/tools/emulator.exe -engine classic -ports 5768,5769 -report-console tcp:5833,max=60 -avd Nexus5X_6_8664 -no-snapshot-load -no-snapshot-save
init: Could not find wglGetExtensionsStringARB!
getGLES2ExtensionString: Could not find GLES 2.x config!
Failed to obtain GLES 2.x extensions string!
Could not initialize emulated framebuffer
emulator: device fd:964

HAXM is working and emulator runs in fast virt mode
emulator: WARNING: Requested adb port (5769) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details.
[android] Emulator reported that the console is available on port 5 768
[android] Waiting for emulator to finish booting...
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe -s emulator-5768 wait-for-device shell getprop init.svc.bootanim
emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.
ERROR: Timeout after 45000 milliseconds

$ D:\Tools\Dev\sdk\/platform-tools/adb.exe kill-server
Finished: NOT_BUILT

更多详情:

方法2:创建新模拟器

Screenshot of the second method

在作业的配置中,选择“在构建期间运行Android模拟器”,然后选择“使用属性运行模拟器”:

  • Android操作系统版本:android-23
  • 屏幕密度:hdpi
  • 屏幕分辨率:480x800
  • 设备区域设置:en_US
  • SD卡尺寸:64M
  • 目标ABI:x86_64
  • 模拟器名称后缀

当我运行该作业时,它会给我以下错误:

Started by user Amine
Building in workspace D:\jenkins\workspace\Emulator
[android] Using Android SDK: D:\Tools\Dev\sdk\
[android] Creating Android AVD: C:\Users\Amine\.android\avd\hudson_en-US_240_WVGA_android-23_x86_64_mySuffix.avd
[android] D:\Tools\Dev\sdk\/tools/android.bat create avd -f -a -c 64M -s WVGA800 -n hudson_en-US_240_WVGA_android-23_x86_64_mySuffix -t android-23 --abi x86_64
[android] Could not create Android emulator: Failed to parse AVD config file
Finished: NOT_BUILT

当我在我的命令行上手动运行相同的命令以调查te错误时,它会出现以下错误:

Error: Flag '-s' is not valid for 'create avd'.

我尝试删除-s然后-t然后请求:

Error: Package path (-k) not specified. Valid system image paths are:
system-images;android-23;default;armeabi-v7a
system-images;android-23;google_apis;x86
system-images;android-23;default;x86_64
system-images;android-23;google_apis;x86_64
system-images;android-23;default;x86
system-images;android-23;google_apis;armeabi-v7a

方法3:使用命令行代替Android Emulator插件

[第三种方法的截图] [3]

然后我决定放弃Android模拟器插件并开始使用jenkins的常规Windows批处理命令,其中包含以下几行:

D:
cd D:\Tools\Dev\sdk\tools\ 
D:\Tools\Dev\sdk\tools\emulator.exe @Nexus5X_6_8664

当我在分离的命令行上运行“adb devices”时,我能够查看最终运行的模拟器;但是,模拟器的窗口不会显示,并且它会一直显示以下错误:

D:\Tools\Dev\sdk\tools>D:\Tools\Dev\sdk\tools\emulator.exe @Nexus5X_6_8664 
Hax is enabled
Hax ram_size 0x60000000
HAX is working and emulator runs in fast virt mode.
init: Could not find wglGetExtensionsStringARB!
OpenGL backend 'angle' without OpenGL ES 1.x library detected. Using GLESv2 only.
eglMakeCurrent failed
eglMakeCurrent failed
eglMakeCurrent failed
eglMakeCurrent failed

请注意,如果我从我的命令行手动运行D:\Tools\Dev\sdk\tools\emulator.exe @Nexus5X_6_8664,我上面的错误没有任何问题。

更多详情:

  • Jenkins服务以管理员身份使用我的登录/密码访问权限运行。 (我已经关注了cloudbees教程并且工作正常)
  • 我已将window.x = 0 window.y = 0添加到@ Nexus5X_6_8664.ini

1 个答案:

答案 0 :(得分:0)

关于方法1的问题: 您可以尝试更新到最新版本的SDK工具吗?我们有类似的问题,并在最新更新后得到修复。

更新以下内容并重试:

  1. Android模拟器[27。2。9(2018年5月)]
  2. Android SDK平台工具
  3. Android SDK工具
  4. Intel x86仿真器加速器(HAXM安装程序)
  5. 按照以下主题更新如何更新: Emulator: ERROR :detected a hanging thread 'Qt event loop'