适用于 Android 4.4 KitKat 的模拟器未启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20051073/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Emulator for Android 4.4 KitKat is not starting
提问by FIXI
I am creating an emulator for Android 4.4 KitKat, but the emulator takes very long and isn't starting. I tried many devices like Nexus4, Galaxy Nexus, Nexus S etc. but none of that worked. Just a black screen with the android logo for long time. Any suggestions?
我正在为 Android 4.4 KitKat 创建一个模拟器,但模拟器需要很长时间并且没有启动。我尝试了许多设备,如 Nexus4、Galaxy Nexus、Nexus S 等,但都没有奏效。只是一个带有android徽标的黑屏很长一段时间。有什么建议?
回答by Boardy
Unfortunately the emulator does take a very long time to load. A regular complaint amongst Android developers.
不幸的是,模拟器确实需要很长时间才能加载。Android 开发人员经常抱怨。
It sometimes helps if you go into the AVD configuration and modify your KitKat emulator and tick the checkbox that says Use Host GPU
. This makes it slightly faster.
如果您进入 AVD 配置并修改您的 KitKat 模拟器并勾选显示Use Host GPU
. 这使它稍微快一点。
Also I've found that if you use the default RAM space that it decides, usually over 1000, it takes a stupidly long time, if it loads up at all. I usually set mine to 512MB, 700+MB at a push but reducing the amount of RAM that the emulator can have helps.
我还发现,如果你使用它决定的默认 RAM 空间,通常超过 1000,它需要很长的时间,如果它完全加载。我通常将我的设置为 512MB、700+MB,但减少模拟器可以拥有的 RAM 量会有所帮助。
There is also a different emulator you can use, although it currently doesn't yet support KitKat, although they say its coming soon, I've heard quite a few positive comments.
还有一个不同的模拟器你可以使用,虽然它目前还不支持 KitKat,虽然他们说它很快就会推出,但我听到了很多积极的评论。
You can find the alternative emulator at http://www.genymotion.com/
您可以在http://www.genymotion.com/找到替代模拟器
UPDATE
更新
Google have released a new version of the Android Emulator with Android Studio 2. Unfortunately, AS, the build tools and the emulator are in Beta/Release Candidates but I've been using them for a while for my own apps and had no problems, but also found that the emulator is much improved from the old one. http://tools.android.com/tech-docs/emulatorwill show you what's new and how to get the new emulator.
Google 已经发布了带有 Android Studio 2 的新版 Android 模拟器。不幸的是,AS、构建工具和模拟器都处于 Beta/Release Candidates 中,但我已经将它们用于我自己的应用程序有一段时间了,并且没有任何问题,但也发现模拟器比旧的有了很大的改进。 http://tools.android.com/tech-docs/emulator将向您展示新功能以及如何获取新模拟器。
回答by sendevent
To find what the problem exactly is, try to run emulator with -debug-all. In my case emulator freezed after:
要找出问题究竟出在哪里,请尝试使用-debug-all运行模拟器。在我的情况下,模拟器在以下情况下冻结:
$./emulator -avd 4.4 -partition-size 1024 -debug-all emulator: found SDK root at ~/data/develop/android/android-sdk-linux …blah-blah-blah… emulator: qpa_audio_init: entering和 -noaudio-noaudio选项解决了这个问题。
回答by Richard
It may help to start the first run of the emulator with a very small amount of memory (say 200mb)
它可能有助于以非常小的内存量(例如 200mb)启动模拟器的第一次运行
On my machine the emulator refused to start (I waited 30 minutes and then killed it) with 700MB It just showed a blank screen - not even the Android message.
在我的机器上,模拟器以 700MB 拒绝启动(我等了 30 分钟然后杀死了它)它只显示一个空白屏幕 - 甚至没有 Android 消息。
When I reduced the memory to 128MB the emulator fired up in the normal time (about 50 seconds on my m/c) but had insufficient RAM to load the background apps. I changed it to 256 MB and everything burst into life. Now I can change the memory up to 768MB it now loads fine in the same timeframe.
当我将内存减少到 128MB 时,模拟器在正常时间(在我的 m/c 上大约 50 秒)启动,但没有足够的 RAM 来加载后台应用程序。我将其更改为 256 MB,一切都变得生动起来。现在我可以将内存更改为 768MB,它现在可以在同一时间范围内正常加载。
Seems like the first run needs to be with a small(er) amount of memory but once that has succeeded you can increase them memory (up to 768MB on Windows) without a problem.
似乎第一次运行需要使用少量(er)内存,但是一旦成功,您就可以毫无问题地增加它们的内存(在 Windows 上高达 768MB)。
回答by Mory
I had the same problem with ...
我有同样的问题...
The solution that worked for me with x86 emulator was to update HAXM with the last version and to restart my computer.
使用 x86 模拟器对我有用的解决方案是使用最新版本更新 HAXM 并重新启动我的计算机。
http://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
http://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
I hope it will help and solve the problem for many of you.
我希望它能帮助和解决你们中的许多人的问题。
Regards
问候
回答by Daber
Mine gets sigabort on surface flinger unless I enable "Use Host GPU".
除非我启用“使用主机 GPU”,否则我的会在表面抛油线上获得 sigabort。
EDIT: Seems this is related to extreme resolutions. Try using lower resolution... if You do use res like 1080x1920 - enabling Host GPU works for me
编辑:似乎这与极端分辨率有关。尝试使用较低的分辨率...如果您确实使用像 1080x1920 这样的分辨率 - 启用主机 GPU 对我有用
Check adb logcat output from emulator while booting, if yours is similar it might work.
启动时检查模拟器的 adb logcat 输出,如果你的类似,它可能会工作。
Please find log below...
请在下面找到日志...
I/Vold ( 46): Vold 2.1 (the revenge) firing up
I/Netd ( 48): Netd 1.0 starting
D/Vold ( 46): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media)
W/InterfaceController( 48): Warning (dlopen failed: library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
I/SurfaceFlinger( 51): SurfaceFlinger is starting
I/SurfaceFlinger( 51): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
D/libEGL ( 51): Emulator without GPU support detected. Fallback to software renderer.
D/libEGL ( 51): loaded /system/lib/egl/libGLES_android.so
D/gralloc_goldfish( 51): Emulator without GPU emulation detected.
E/SurfaceFlinger( 51): hwcomposer module not found
E/SurfaceFlinger( 51): ERROR: failed to open framebuffer (No such file or directory), aborting
F/libc ( 51): Fatal signal 6 (SIGABRT) at 0x00000033 (code=-6), thread 51 (surfaceflinger)
I/DEBUG ( 49): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 49): Build fingerprint: 'generic/sdk/generic:4.4.2/KK/986172:eng/test-keys'
I/DEBUG ( 49): Revision: '0'
I/DEBUG ( 49): pid: 51, tid: 51, name: surfaceflinger >>> /system/bin/surfaceflinger <<<
I/DEBUG ( 49): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/DEBUG ( 49): r0 00000000 r1 00000033 r2 00000006 r3 00000000
I/DEBUG ( 49): r4 00000006 r5 00000002 r6 00000033 r7 0000010c
I/DEBUG ( 49): r8 b6fd084d r9 b7f1552c sl 00000000 fp bef71b9c
I/DEBUG ( 49): ip fffffffe sp bef719e8 lr b6f34ead pc b6f43e20 cpsr 00000010
I/DEBUG ( 49): d0 0036f09323cb6394 d1 0000000000000000
I/DEBUG ( 49): d2 0000000000000000 d3 0000000000000000
I/DEBUG ( 49): d4 0000000000000000 d5 41c1e5b1ca000000
I/DEBUG ( 49): d6 3f50624dd2f1a9fc d7 414b7849ee147ae1
I/DEBUG ( 49): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 49): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 49): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 49): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 49): scr 00000010
I/DEBUG ( 49):
回答by Mark E
Having had the same problem, I configured AVD to use 516MB of RAM and it loaded ok. Hope this helps you or someone else.
遇到同样的问题,我将 AVD 配置为使用 516MB 的 RAM,并且加载正常。希望这可以帮助您或其他人。
回答by ChuongPham
Maybe ADB is kaput!
也许亚行是 kaput!
If you're using Windows to develop Android, then open a DOS session at \android-sdk\platform-tools\
directory (Note: This is a sub-directory of the Android SDK installation).
如果您使用 Windows 开发 Android,则在\android-sdk\platform-tools\
目录中打开 DOS 会话(注意:这是 Android SDK 安装的子目录)。
At the DOS window, type:
在 DOS 窗口中,键入:
adb kill-server
This would kill the current Android Debug Bridge (ADB). Then, start it again by typing:
这将杀死当前的 Android 调试桥 (ADB)。然后,通过键入以下内容再次启动它:
adb start-server
To verify if your Android 4.4 KitKat emulator is running, type:
要验证您的 Android 4.4 KitKat 模拟器是否正在运行,请键入:
adb devices
If it still doesn't work, repeat the above steps. Else, restart your IDE (Eclipse, Android Studio, etc) and try again.
如果还是不行,重复上面的步骤。否则,重新启动您的 IDE(Eclipse、Android Studio 等)并重试。
回答by Jose_GD
I had the same problem, what helped was reboot my computer and start the emulator with only a few programs open (Eclipse, Chrome and nothing more). My development computer is a 4 GB notebook with integrated graphics running Ubuntu 12.04. Nothing fancy, and the KitKat emulator works. Very slowly, as expected :(, but works.
我遇到了同样的问题,帮助我重新启动计算机并在仅打开几个程序(Eclipse、Chrome 等等)的情况下启动模拟器。我的开发计算机是 4 GB 笔记本电脑,带有运行 Ubuntu 12.04 的集成显卡。没什么特别的,KitKat 模拟器可以工作。正如预期的那样非常缓慢:(,但有效。
Take into account that emulators are memory hungry, perhaps your development machine is low on resources when you try to run them?
考虑到模拟器需要大量内存,也许当您尝试运行它们时,您的开发机器资源不足?
回答by Jason Gore
The biggest problem with the SDK right now is that there is no x86 emulator image posted.
SDK 目前最大的问题是没有发布 x86 模拟器图像。
However, I did get a KitKat x86 emulator working in Windows by hacking together INIs from an x86 JB AVD and an ARM KitKat AVD, as well as building aosp_x86-eng and copying over the prebuilt QEMU kernel for x86 from the KitKat AOSP into my Windows host. An x86 KitKat image running in Windows with the HAXM extensions is very fast, as fast or faster than running on actual hardware, particularly with "Use host GPU" enabled.
但是,我确实通过将来自 x86 JB AVD 和 ARM KitKat AVD 的 INI 组合在一起,以及构建 aosp_x86-eng 并将用于 x86 的预构建 QEMU 内核从 KitKat AOSP 复制到我的 Windows 中,获得了在 Windows 中运行的 KitKat x86 模拟器主持人。在带有 HAXM 扩展的 Windows 中运行的 x86 KitKat 映像非常快,与在实际硬件上运行的速度一样快或更快,尤其是在启用“使用主机 GPU”的情况下。
If you're not building Android itself, this probably doesn't help you. But if you ARE building AOSP (or you can find a prebuilt x86 KitKat Android image and QEMU kernel online), I can post additional details on how to get it working in Windows.
如果您不是在构建 Android 本身,这可能对您没有帮助。但是,如果您正在构建 AOSP(或者您可以在线找到预构建的 x86 KitKat Android 映像和 QEMU 内核),我可以发布有关如何使其在 Windows 中工作的更多详细信息。
回答by uLYsseus
This might have been answered ...but I had an issue and it got solved...please see this post and I am sure you will hit it correct: Setting Up Android 4.4 kitkat emulator
这可能已经得到了回答......但我遇到了一个问题,它得到了解决......请参阅这篇文章,我相信你会正确地找到它: 设置 Android 4.4 kitkat 模拟器
Let me know if it works...
让我知道它是否有效...