Making the Android emulator run faster
The Android emulator is a bit sluggish. For some devices, like the Motorola Droid and the Nexus One, the app runs faster in the actual device than the emulator. This is a problem when testing games and visual effects.
How do you make the emulator run as fast as possible? I've been toying with its parameters but haven't found a configuration that shows a noticeable improvement yet.
Official web page
~50% faster
Windows:
Go to the Android SDK root folder and navigate to extrasintelHardware_Accelerated_Execution_Manager. Execute file IntelHaxm.exe to install. (in Android Studio you can navigate to: Settings -> Android SDK -> SDK Tools -> Intel x86 Emulator Accelerator (HAXM installer))
Create AVD with "Intel atom x86" CPU/ABI
Also don't forget install this one
PS during AVD creation add emulation memory: Hardware/New/Device ram size/set up value 512 or more
Linux:
PS For Fedora, for Ubuntu
OS-X:
PS: Check this tool, very convenient even trial
UPDATE: Now that an Intel x86 image is available, the best answer is by zest above.
As CommonsWare has correctly pointed out, the emulator is slow because it emulates an ARM CPU, which requires translation to Intel opcodes. This virtualization chews up CPU.
To make the emulator faster, you have to give it more CPU. Start with a fast CPU or upgrade if you can.
Then, give the emulator more of the CPU you have:
I'm seeing somewhere around a 50% improvement with these two changes in place.
To set processor affinity on Windows 7:
Note: When you change affinity in this way, it's only changed for the lifetime of the process. Next start, you have to do it again.
I would like to suggest giving Genymotion a spin. It runs in Oracle's VirtualBox, and will legitimately hit 60 fps on a moderate system.
Here's a screencap from one of my workshops, running on a low-end 2012 model MacBook Air:
If you can't read the text, it's a Nexus 7 emulator running at 56.6 fps. The additional (big!) bonus is that Google Play and Google Play Services come packaged with the virtual machines.
(The source of the demoed animation can be found here.)
链接地址: http://www.djcxy.com/p/90526.html上一篇: Android模拟器未启动
下一篇: 让Android模拟器运行得更快