"[android] 模拟器似乎没有启动;放弃" [英] "[android] Emulator did not appear to start; giving up"

查看:34
本文介绍了"[android] 模拟器似乎没有启动;放弃"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jenkins 无法启动模拟器.这是詹金斯的控制台输出:

Jenkins can't start the emulator. Here is the console output of 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.

I run jenkins on ubuntu 12.04.

推荐答案

错误SDL init failure, reason is: No available video device"表明模拟器未在图形环境中运行.

The error "SDL init failure, reason is: No available video device" would suggest that the emulator isn't running in a graphical environment.

但是,您的日志显示 VNC 服务器正在正在启动.但也许 VNC 服务器在模拟器启动时还没有完全启动.

However, your log shows that a VNC server is being started. But perhaps the VNC server hasn't quite finished starting by the time the emulator starts.

您可以通过将模拟器启动延迟几秒钟来检查是否是这种情况.

You can check whether this is the case by delaying the emulator start by a few seconds.

来自 Android 模拟器插件文档:

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

Although the Android Emulator plugin has been designed to ensure it always runs after an Xvnc server has been started, the Xvnc plugin does not wait for the Xvnc server to be fully up-and-running before handing control over to the Android Emulator plugin.

出于这个原因,您可能希望将模拟器启动延迟几秒钟(例如三到五秒),让 Xvnc 服务器在尝试启动 Android 模拟器之前有时间完成启动.为此,请在启动延迟"中输入所需的秒数.高级"下的字段选项.

For this reason, you may want to delay emulator startup by a few seconds (e.g. three to five), giving the Xvnc server time to finish starting-up before attempting to launch an Android emulator into it. To do so, enter the desired number of seconds in the "Startup delay" field under "Advanced" options.


或者,您可以取消勾选显示模拟器窗口";作业配置中的选项,它不会显示模拟器,并且不需要运行 VNC 服务器.


Alternatively, you can untick the "Show emulator window" option in your job configuration, which won't show the emulator, and will remove the need to run a VNC server.

这篇关于"[android] 模拟器似乎没有启动;放弃"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆