开发者

Android Emulator hang up and impossible to quit

I've installed the Android plugin on Eclipse 3.6 in a regular way (aka i followed step by step the google installation page).

When I launch any sample application, everything works fine, but if I try to quit the emulator (by clicking the exit cross button of the emulator), the emulator seems to hang completly.

What is very bothering is that I can't even kill the process, launch another emulator or even reboot my pc, since the process seems to be impossible to stop or kill.

Does anyone have similar problem, and a soluti开发者_如何学JAVAon to give?


I have seen this issue with the emulator when running Linux on some machines. That problem was related to the audio and could be helped by setting the -noaudio option when launching the emulator.

You can add emulator options in preferences-Android-Launch in eclipse. Just add -noaudio to the "default emulator options" field.


Hang on quit due to audio handling thread is a known bug:

http://code.google.com/p/android/issues/detail?id=17294

To work around this issue, disable audio input in the AVD manager with "Audio recording support" set to "no", which sets "hw.audioInput=no" in the qemu ini file.


First, I was able to confirm on my system (Win7 x64, Eclipse Helios SR2) the eclipse hanging situation was due to the audio defect noted. (I did this by starting an emulator from the command line and using the -noaudio option. Eclipse will use the existing emulator and it no longer hangs.)

However, I cannot get Eclipse to use the "-noaudio" value I put in the "default emulator options" field. I also tried "noaudio" but it didn't work. Checking the command-line of the process, the "-noaudio" option is not present; just the rest of the standard options.


I still had this problem with WXP SP3 and ADT-Bundle-Windows-X86 (which is an pre-bundled Eclipse with ADT; SDK r21).

I tried some of the tips above, but none worked when starting the emulator from eclipse. The emulator hangs after quitting and prevents Windows shutdown.

  • setting hw.adioInput=no: after trying several config files, the file <user dir>\.android\avd\<emulator name>.avd\hardware-qemu.ini seemed to be the right one. To my disappointment, this file is rewritten every time eclipse starts the emulator.
  • setting -noaudio in Preferences\Android\Launch\Default emulator options did not work, as @RodBarnes mentioned

What finally worked (for me), is one of those two options:

  • Either create a batch file to start the emulator, using a command line of emulator @<emulator name> -noaudio, assuming emulator.exe is on your path. Else prefix it with the complete path to emulator.exe. Eclipse will recognize the running emulator and use it.
  • Or set a command line option for every single run configuration. You find it under Run\Run configurations...\<Your configuration>\Target\Additional Emulator Commandline Options. Enter -noaudio here. You may need to scroll the Target panel down a bit to see the option. Some other comments i found mentioned that in some Eclipse versions the scrollbar is missing, so try to increase the window size.

I for myself prefer the first option as you need a single batch file for each emulator only, and do not need to change every single run configuration.


If you are using linux, tap command xkill, then be careful, click in something you want to kill. In this case after command you should click on emulator and then it will be killed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜