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.

It's funny because the iPhone simulator is exactly the opposite. The apps run slower on the device. In most cases I prefer a slower emulator, because it stimulates you to improve your app, but sometimes you just want to see it work like it does in a real device.
–
hpiqueApr 18 '10 at 15:14

OS-X:

In Android SDK Manager, install Intel x86 Atom System Image

In Android SDK Manager, install Intel x86 Emulator Accelerator (HAXM)

In finder, go to the install location of the Intel Emulator Accelerator and install IntelHAXM (open the dmg and run the installation). You can find the location by placing your mouse over the Emulator Accelerator entry in the SDK Manager.

This works in OSX as well. You need to install /extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM.dmg after you download the package from the SDK manager.
–
Jarett MillardMay 8 '13 at 15:57

3

The Windows instructions with "Use Host GPU" gave me a super-fast emulator! (I have a supported Intel processor and an nVidia graphics card.) The animations are buttery smooth (most of the time; at other times, very little jerkiness)! Note that you have to restart Eclipse for the AVD Manager to pick up the Intel Atom (x86) CPU option. Tip: Don't allocate too much RAM. With 1GB RAM, emulator failed to start (with GPU) but with 512MB RAM it ran smoothly and booted really quickly (again with GPU).
–
ADTCJul 28 '13 at 16:11

I found that the LogCat gets spammed with a lot of Trace warnings. To filter them out, use ^(?!.*(nativeGetEnabledTags)).*$ as the text filter. I have reported this as a bug issue. Also, I think you have to properly shut down your emulator device (hold the power button, then select Power off) to avoid having errors when you start it the next time (I could just close the ARM emulator, but with the Intel emulator, just closing seems to create problems).
–
ADTCJul 28 '13 at 17:11

I'd give you +100 if I could. Works on Windows 8 and performances increased terrificly!
–
Paolo MAug 7 '13 at 15:28

1

I had to disable Hyper V technology first through program and features under the control panel to get this to work.
–
Mike FlynnJan 4 '14 at 0:03

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:

Disable Hyperthreading - Since the emulator doesn't appear to utilize more than one core, hyperthreading actually reduces the amount of overall CPU time the emulator will get. Disabling HT will slow down apps that take advantage of multiple CPUs. Hyperthreading must be disabled in your BIOS.

Make the emulator run on a CPU other than CPU 0 - This has a much smaller impact than turning off HT, but it helps some. On Windows, you can specify which CPU a process will run on. Many apps will chew up CPU 0, and by default the emulator runs on CPU 0. I change the emulator to run on the last one. Note that on OS X you cannot set affinity (see: http://superuser.com/questions/149312/how-to-set-processor-affinity-on-a-mac).

I'm seeing somewhere around a 50% improvement with these two changes in place.

To set processor affinity on Windows 7:

Open Task Manager

Click View All Processes (to run as administrator, otherwise you can't set processor affinity)

Right click on emulator.exe and choose Set Affinity...

On the Set Affinity dialog, select just the last CPU

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.

You only see a doubling in the number task manager shows; not in reality. If you're not running enough software to generate enough work to have the equivalent of at least 4 threads at 100% CPU the the few apps doing heavy CPU usage will still effectively get almost the entire core, not the half core your naive assumption of what task manager is displaying means.
–
Dan NeelyJul 27 '12 at 13:24

3

To confirm what @Dan Neely says: I have a single core app, that just burns 100% cpu. When I have HT it shows about 25%, without it shows about 50%, but in fact in computes what it has to compute in the same time. So no difference (at least on Sandy Bridge).
–
bartosz.rSep 13 '12 at 22:57

Enable GPU Hardware Acceleration (in addition to Intel's HAXM), if you are using API 15 v3 or newer and SDK Tools v17+. Graphics acceleration for the emulator takes advantage of your development computer's graphics hardware, specifically its graphics processing unit (GPU), to make screen drawing faster. This gives a noticeable boost in speed.

To enable graphics acceleration enabled by default on your emulator: when creating the AVD, in the Hardware section, click New, select GPU emulation and set the value to Yes.

To enable acceleration only at runtime: use the -gpu flag while starting the emulator like this:

I recently switched from a core 2 @ 2.5 with 3gb of ram to an i7 @ 1.73 with 8gb ram (both systems ran Ubuntu 10.10) and the emulator runs at least twice as fast now. Throwing more hardware at it certainly does help.

I noticed that the emulator defaults to only Core 0, where most Windows applications will default to "any" core. Also, if you put it on another core (like the last core), it may make the emulator go crazy. If you can, you can try putting your heavy-CPU usage applications on the other CPU cores for a boost in speed.

Hardware-wise, get the fastest CPU you can get that works for single-core applications. More than 2 cores might not experience a huge difference in terms of emulator performance.

Eclipse + the Android emulator together eat up a ton of RAM. I would recommend 3 gigs of RAM at least because I used a system with 2 gigs of RAM, and it slowed down because the system ran out of RAM and started to use the page file.

I feel that the best CPUs for it will probably have a high clock (only use clock as a measure for CPUs in the same series btw), handle non-SIMD operations well, and have a turbo boost mechanism. There aren't many Java-based benchmarks, but overall look for application benchmarks like compression and office. Don't look at gaming or media since those are affected greatly by SIMD. If you find a Java one, even better.

On this year google I/O (2011), Google demonstrated a faster emulator. The problem is not so much on the byte code between ARM and x86 but the software rendering performed by QEMU. They bypass the rendering of QEMU and send the rendering directly to an X server I believe. They showed a car game with really good performace and fps.

I think it is because clr virtual machine uses cpu directly without code opcode translation.
It may be optimization for clr application or may be windows mobile/window phone 7 started on INTEL proccessor.
Android platform based on linux and theoretically you can start android on virtual machine in i686 environment. In this case virtual machines such as vmware could execute some opcodes direcly. But this option will be allowed only if you write on the Java. Because the Java interpret their byte-code or precompile it before execution.
see:
http://www.taranfx.com/how-to-run-google-android-in-virtualbox-vmware-on-netbooks