Android模拟器是基于QEMU的。我可以使用 KVM 吗?
我的笔记本支持硬件虚拟化(AMD SVM),我知道:
- QEMU可以通过KVM利用硬件虚拟化;
- Android 模拟器很大程度上基于 QEMU
自然问题如下:我可以将两者(Android + KVM)结合起来以提高模拟器的性能吗?
My laptop supports hardware virtualization (AMD SVM) and I know that:
- QEMU can make use of hardware virtualization through KVM;
- The Android emulator is very much based on QEMU
Natural question follows: can I combine the two (Android+KVM) to get improved performance in the emulator?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
是的,你可以。只需在 Android SDK 中下载适当的 Intel Atom CPU 软件包,然后让您的 AVD 使用 Intel Atom CPU 架构。 Android模拟器甚至可以使用主机GPU。以下是有关如何执行此操作的链接:
http://developer.android.com/tools/devices/ emulator.html#acceleration
Yes, you can. Just download the appropriate Intel atom CPU packages in the Android SDK and have your AVD use an Intel atom CPU architecture. The android emulator can even use the host gpu. Here is a link on how to do it:
http://developer.android.com/tools/devices/emulator.html#acceleration
您可以尝试使用 AndroidVM - http://androvm.org/blog/ ...在我的测试中也可以有硬件 OpenGL 和旋转支持(这有点复杂,但一切都在 AndroidVM 页面上进行了解释)。
根据我的经验,这比 Android SDK 模拟器好得多,至少在 Windows 和 Mac 上是这样。
对于 Linux,您应该能够使用 VirtualBox for Linux 来使用 AndroidVM。由于它主要是 OVA 文件,因此您应该能够根据需要使用其他虚拟化客户端。
有趣的是,这不是模拟 ARM,而是 x86 上的 Android...这有优点也有缺点,但如果你可以在虚拟机上进行各种初始测试,那么绝对有助于不必购买大量设备,因为Android 4.1 通常不会被 ARM 和 x86 手机和平板电脑等制造商进行过多修改(IMO)。
You can try to use AndroidVM - http://androvm.org/blog/ ... In my testing you can have Hardware OpenGL and Rotation Support as well (this is slightly convoluted but everything is explained on the AndroidVM page).
In my experience this is miles better than the Android SDK Emulator, at least on Windows and Mac.
For Linux, you should be able to use VirtualBox for Linux to use AndroidVM. Since it is an OVA file mainly, you should be able to use other Virtualisation clients as needed.
What's interesting is that this is NOT emulating ARM, it is Android on x86... which has pros and cons, but definitely helps in not having to buy a ton of devices if you can do initial testing of various sorts on virtual machines, since Android 4.1 is generally not too heavily modified by manufacturers across ARM and x86 phones and tablets, etc (IMO).
您可以在带有 KVM 的 QEMU 中(甚至在 VirtualBox 中)运行 Android-x86。我不确定设置开发有多容易,但它应该运行得更快一些。此外,英特尔正在致力于在其 x86 芯片上支持 Android,因此希望将来会变得更容易。
更新:我设法让它在 VirtualBox 中工作,除了一些网站使网络浏览器崩溃。由于我正在制作一个网络应用程序,所以这没有帮助。不过它比标准 Android 模拟器要快得多,
You can run Android-x86 in QEMU with KVM (or even in VirtualBox). I'm not sure how easy it would be to set up for development but it should run quite a bit faster. Also, Intel are working on getting Android on their x86 chips so this will hopefully become easier in the future.
Update: I managed to get it working in VirtualBox, except some sites crash the web browser. Since I was making a web app, this was not helpful. It was much faster than the standard Android emulator though,
与您所追求的答案并不密切相关,但是
Run
(与调试相比,它要快得多,甚至快 10 倍)Debug
运行,学会完美编码,因此少用 Debug。Not closely related to the answer you are after, but
Run
when you work on your interface, or as much as possible while coding (it's a lot faster compared to Debug, even 10 times faster)Debug
runs, learn to code perfect, so use less Debug.针对 x86 的 Google TV 模拟器支持 KVM 模式虚拟化。
ARM还没有做到这一点。我相信目前正在进行中。
Google TV emulator which is targeted at x86 supports KVM mode virtualization.
ARM is not there yet. I believe it's currently work-in-progress.