使用Google API的Android模拟器无法在Ubuntu Server 16.04上使用Jenkins启动

时间:2017-08-03 18:08:18

标签: android jenkins android-emulator ubuntu-server

在Ubunut Server 16.04上使用Jenkins和Android Emulator Plugin,当我将操作系统版本设置为" android-19"时,我设法让它工作。下面是设置的简短屏幕截图:

enter image description here

虽然这适用于插件和模拟器,但我的应用程序需要Google Play服务才能正常运行。使用Google API搜索android的图像(这听起来像我需要的)我在插件的帮助页面中找到了它,因为它说:

  

如上所述," Android操作系统版本"字段将自动完成   到现有的SDK版本,例如" 1.5"或" 2.2"。但是,确实如此   可以在此字段中输入不同的值,例如,如果您   想要使用已安装的Android SDK插件,例如该   Google API插件或Samsung GALAXY Tab插件。在这些情况下,   只需输入" android列表目标"给出的适当值   命令。

     

例如:Google API插件,基于Android 1.6   模拟器:Google Inc.:Google API:4

所以我尝试用以下版本填写Android操作系统版本:Google Inc.:Google API:19,但却发现我在使用Target ABI时遇到了一些问题。进一步搜索我发现在使用OS的这个命名时,我必须在Target ABI之前添加一个标签。它应该是:" google_apis / armeabi-v7a"

然后设置如下:

enter image description here

但是当我构建时,我得到一个等待模拟器启动的长控制台终端消息,看起来好像永远不会发生:

$ /var/lib/jenkins/tools/android-sdk/tools/android list target
[android] Using Android SDK: /var/lib/jenkins/tools/android-sdk
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb start-server
* daemon not running. starting it now at tcp:5825 *
* daemon started successfully *
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb start-server
[android] Starting Android emulator
$ /var/lib/jenkins/tools/android-sdk/tools/emulator -engine classic -ports 5782,5783 -report-console tcp:5836,max=60 -prop persist.sys.language=pt -prop persist.sys.country=BR -avd hudson_pt-BR_160_WQVGA_Google_Inc._Google_APIs_19_google_apis-armeabi-v7a_testing2 -no-snapshot-load -no-snapshot-save -no-window
WARNING: Force to use classic engine to support snapshot.
ERROR: resizing partition e2fsck failed with exit code 8
emulator: WARNING: Classic qemu does not support SMP. The hw.cpu.ncore option from your config file is ignored.
emulator: warning: opening audio output failed

emulator: WARNING: Requested adb port (5783) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details.
emulator: Listening for console connections on port: 5782
emulator: Serial number of this emulator (for ADB): emulator-5782
[android] Emulator reported that the console is available on port 5,782
[android] Waiting for emulator to finish booting...
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
$ /var/lib/jenkins/tools/android-sdk/platform-tools/adb -s emulator-5782 wait-for-device shell getprop init.svc.bootanim
[android] Emulator reported that the startup process is ''
[android] Timed-out after waiting 360 seconds for emulator
[android] Stopping Android emulator

安卓操作系统版本android-19的[android] Emulator reported that the startup process is ''显示为[android] Emulator reported that the startup process is 'running',但使用Google API似乎无法启动。

我设置错误了什么?

1 个答案:

答案 0 :(得分:0)

我正在调查类似的问题。您遇到的#1问题是,仿真器正在尝试连接到不存在的adb端口。

$ / var / lib / jenkins / tools / android-sdk / platform-tools / adb启动服务器  守护程序未运行。现在从 tcp:5825

开始

/ var / lib / jenkins / tools / android-sdk / tools / emulator -engine classic -ports 5782,5783 -report-console tcp:5836 ,max = 60 -proppersist.sys .language = pt -proppersist.sys.country = BR -avd hudson_pt-BR_160_WQVGA_Google_Inc._Google_APIs_19_google_apis-armeabi-v7a_testing2 -no-snapshot-load -no-snapshot-save -no-window 警告:强制使用经典引擎来支持快照。

如果您可以使这些端口匹配,则应该可以使用。我的猜测是插件存在问题。可能存在某些文件权限问题,或者插件中的任何内容旨在使端口在两次执行之间匹配。有一个环境变量,您可以在其中指定adb服务器端口。我是詹金斯的新手,还没有开始工作。