小编典典

“ [android]模拟器似乎没有启动;放弃”

jenkins

Jenkins无法启动模拟器。这是jenkins的控制台输出:

First time build. Skipping changelog.
Starting xvnc
[MatchMaking] $ vncserver :65 -localhost -nolisten tcp

New 'veam:65 (jenkins)' desktop is veam:65

Starting applications specified in /var/lib/jenkins/.vnc/xstartup
Log file is /var/lib/jenkins/.vnc/veam:65.log

$ /usr/local/android-sdk/tools/android list target
[android] Using Android SDK: /usr/local/android-sdk
[android] Adding 256M SD card to AVD 'hudson_en-US_160_WXGA720_android-15_x86'...
$ /usr/local/android-sdk/platform-tools/adb start-server
$ /usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86
[android] Starting Android emulator and creating initial snapshot
[android] Erasing existing emulator data...
$ /usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data
SDL init failure, reason is: No available video device
* daemon not running. starting it now on port 39546 *
* daemon started successfully *
[android] Emulator did not appear to start; giving up
$ /usr/local/android-sdk/platform-tools/adb disconnect localhost:34583
[android] Stopping Android emulator
$ /usr/local/android-sdk/platform-tools/adb kill-server
Terminating xvnc.
$ vncserver -kill :65
Killing Xvnc4 process ID 16861
Finished: NOT_BUILT

如果我输入

/usr/local/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_WXGA720_android-15_x86

要么

/usr/local/android-sdk/tools/emulator -no-boot-anim -ports 60491,34583 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WXGA720_android-15_x86 -no-snapshot-load -no-snapshot-save -wipe-data

我懂了

PANIC: Could not open: hudson_en-US_160_WXGA720_android-15_x86

我在ubuntu 12.04上运行jenkins。


阅读 327

收藏
2020-07-25

共1个答案

小编典典

错误“ SDL初始化失败,原因是:没有可用的视频设备”将表明模拟器不在图形环境中运行。

然而,你的日志显示,VNC服务器 正在启动。但是,也许到模拟器启动时,VNC服务器还没有完全启动。

您可以通过将仿真器启动延迟几秒钟来检查是否是这种情况。

Android Emulator插件文档中

尽管已设计Android
Emulator插件来确保它在启动Xvnc服务器后始终运行,但是Xvnc插件不会等待Xvnc服务器完全启动并运行,然后再将控制权移交给Android
Emulator插件。

因此,您可能希望将仿真器启动延迟几秒钟(例如,三到五秒),以便在尝试向其中启动Android仿真器之前,给Xvnc服务器时间来完成启动。为此,请在“高级”选项下的“启动延迟”字段中输入所需的秒数。


或者,您可以取消选中作业配置中的“显示仿真器窗口”选项,该选项将不显示仿真器,并且无需运行VNC服务器。

2020-07-25