Skip to content

Speeding Up your Emulator

Dutch Matous edited this page Aug 4, 2013 · 1 revision

I gave a quick demo at a meetup of an emulator that was hardware accelerated and running Google maps v2.

Here is some info in case people want to try it:


Enabling hardware emulation for your Android vm:

Your Android emulator that comes with the Android SDK is basically a virtual machine, a complete operating system that runs inside your primary OS.

Many modern CPUs have hardware support for emulation. For recent Intel hardware (that is used on both PCs and Apple producs) this support is made available through the HAXM driver.

Using XAXM support with the Android emulator involves several steps:

  1. Enabling hardware emulation in your computer's bios this is normally disabled by default, and you may need to poke around a bit to find it. In my Lenovo ThinkPad, it was found under Security, and not CPU or something like that.

  2. Download the x86 Atom system images. These must be used, which was a switch from the ARM images I was using previously

  3. Download and install the HAXM driver.

  4. Create a x86 AVD For best results, you should also have GPU emulation set to 'yes'. This offloads OpenGL calls to your host GPU. Without it, your emulator's display will be slower in updating. Note you cannot use the 'Snapshot' feature with GPU emulation.

Using this will speed up your emulator considerably. Here are a couple of links with more detailed instructions:

http://www.developer.com/ws/android/development-tools/supercharge-your-android-emulator-speed-with-intel-emulation-technologies.html http://software.intel.com/en-us/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-mac-os-x


Using Google maps v2 with HAXM:

Currently, there is one big caveat to using the HAXM driver: when you create the x86 AVD, you will only be allowed to target bare Android, but not the Google APIs. This is a problem if you are developing against Google APIs, including Google Maps.

If you only want to use Google maps with HAXM, there is a hack to get that working. You basically push two APKs to your x86 Android-only AVD. The trick is getting the correct version of those jars. I have uploaded the current version that I am using to the Files section of the meetup. To install them, you start your AVD, and then from the command line, type:

adb -e install com.google.android.gms.apk

adb -e install com.android.vending.apk

and restart the AVD.

It is supposedly possible to pull th APKs from a google-API enabled AVD, but I haven't tried that.

Here is a link with people who have struggled with the problem: http://stackoverflow.com/questions/14040185/running-google-maps-v2-on-android-emulator/17036337