Speed up the Android Emulator

The Android emulator

I’ve always hated the Android emulator, it actually puts me off developing for versions of Android that I don’t have a real device for (fortunately, I have a lot).

It’s always better to test on real devices anyway, especially since not all versions of Android are the same, despite the Android version number being the same. This is thanks to the hardware manufacturers enhancing Android “with Samsung Touchwiz” or “with HTC Sense” etc, that are neither wizzy nor sensible.

What’s the main reason why I hate the emulator? Because I have time to make and drink a coffee before it loads. There is is only so much coffee one man can drink.

How to speed it up!

That’s right, it is possible to speed up the emulator (drastically) if you have an Intel VT enabled machine and you’re targeting Android 4.0.3 (API version 15) or greater. This solution doesn’t even touch eclipse, I promise.

Step 1

Find out what you’re missing. Run $ android update sdk to launch the Android SDK manager. You’ll notice that each Android version with an API entry of version 15 or greater has an Intel x86 Atom System Image option alongside the ARM system image. You need to install these Intel x86 Atom System Images for each API version you plan to target (you’ll also need each SDK platform if you haven’t installed them already).

Now when you run android list targets you should see Tag/ABIs : default/x86 at the bottom of each target entry (and default/armeabi-v7a if you have that installed too).

Step 2

Download the Intel Hardware Accelerated Execution Manager or HAX(M) for short. This is a hardware-assisted virtualisation engine (hypervisor) that speeds up Android app emulation on a host machine. In combination with Android x86 emulator images it allows for faster Android emulation on Intel VT enabled systems.

Step 3

Create your new Android Virtual Devices (AVDs), (more info here). The key is to specify which ABI to use, which is missed out from the documentation. e.g:

$ android create avd -n <NAME> -t <id> --abi default/x86

You’ll still have time to make a coffee but perhaps not to drink it :)