When I first started developing in Android, putting the finishing touches on my various Hello World style apps, I couldn’t help but notice just how slow the emulator would run. I eventually switched to using my phone instead of the emulator, since it was leaps and bounds smoother. But the emulator can be sped up, both significantly, and easily.
Allow me to introduce you to Intel HAXM, or “Hardware Accelerated Execution Manager”. Which Intel defines as:
…a hardware-assisted virtualization engine (hypervisor) that uses Intel Virtualization Technology (Intel® VT) to speed up Android app emulation on a host machine.
Setting it up in your environment is actually surprisingly easy, and the official guide isn’t too complicated to follow. Here though, I’m going to summarize the installation and setup in point form.
- Android SDK – version 17+
- Intel® processor with support for Intel VT-x, EM64T, and Execute Disable Bit functionality – (The install process verifies this prerequisite for you – see “Step 2” below)
- 1GB+ of RAM
Step 1 – Download HAXM and Images
Fire up your trusty SDK Manager and peruse the “Extras” section down at the bottom. The item you’re going to install is “Intel x86 Emulator Accelerator (HAXM)”
While you’re in the SDK, select the Intel “Atom System Image” for whichever APIs you wish to run in your emulator.
The SDK Manager merely downloads HAXM for you, even though it will say “Installed”, it’s a tad misleading. Which brings us to our next step
Step 2 – Installing HAXM
Locate HAXM, which the SDK should’ve downloaded it here for you:
<root sdk directory>extrasintelHardware_Accelerated_Execution_Manager
Open that directory and run “IntelHaxm.exe” to install it. If your system is not capable of running HAXM, the install will fail, according to Intel:
Intel HAXM installation will fail if your system does not meet the system requirements, including support for Intel processor features, such as Intel Virtualization Technology (Intel VT).
Step 3 – Setup a New Android Emulator
Note: If you see “No system images installed for this target”, refer to the “Troubleshooting” section below.
When creating a new Android Virtual Device (emulator), select the API level that you installed the intel image for, and then select “Intel Atom” for the CPU/ABI option. It also helps to check “Use Host GPU”
“No system images installed for this target”
Something I’ve run into during this process is that when I would try to setup a new emulator, the CPU/ABI section would say “No system images installed for this target”:
What in the world? But we did installed system images… Don’t worry, it’s a fairly easy fix. Navigate to here (substitute the 19 with whichever version you want to use):
<root sdk directory>system-imagesandroid-19
Do you see a “default” subfolder? Rip the contents from there and place it directly underneath android-XX, essentially you want to eliminate the “default” folder, moving all of it’s contents up one level to where the default folder was. Then give eclipse a good ol’ restart, and it should be fixed!