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

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

问题描述

Jenkins无法启动模拟器.这是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初始化失败,原因是:没有可用的视频设备"将表明模拟器不在图形环境中运行.

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插件在将控制权移交给Android Emulator之前不会等待Xvnc服务器完全启动并运行插件.

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.

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

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天全站免登陆