Getting Intel’s HAXM hardware accelerated Android AVD running on your system

Getting Intel’s HAXM hardware accelerated Android AVD running on your system

One of the (frankly) terrible aspects of doing Android development is the horrendously slow Android emulator. This is especially true if you do OpenGL ES development.  Fear not!  Intel has come to the rescue.  They’ve released HAXM (Hardware Accelerated Execution Manager) that dramatically speeds up your Android development and emulation.  Best part is that it’s free. The amount of time you’ll save on app start up alone makes it worth every moment you’ll spend setting it up.

Setup:

  1. Install Eclipse as your normally would
  2. Open the Eclipse SDK Manager.
  3. Install one of the latest Android API packages with two important points:
    1. The API level MUST INCLUDE AN INTEL X86 ATOM SYSTEM IMAGE (API 17 at the time of this writing).
    2. Also select the HAXM support.  Found in: ‘Extras’->’Intel x86 Emulator Accelerator (HAXM)’
      Untitled
  4. After those packages are all installed, close the manager and open Eclipse.
  5. Open a workspace and get an app ready to test (use one of the samples if necessary)
  6. Go to: Run->Run Configurations
  7. Right-click ‘Android Application’ on the list on the left and select ‘New’
  8. I named mine Standard_Run_Configuration – but you can name yours whatever.
    Untitled2
  9. Put the project name in the Project box (mine was AndroidCubeStart)
  10. Select the ‘Target’ Tab.
  11. Select the ‘Automatically pick compatible device…” option, then select the ‘Manager’ button.
    Untitled3
  12. At the Manager pane, select ‘New…’
  13. Fill out the AVD with these notes:
    1. Target MUST be one of the API target levels that has the Atom system image (see step 3)
    2. CPU/ABI must be Intel Atom (x86)
    3. In the ‘Emulation Options’ list, select ‘Use Host GPU’
    4. Select OK to save
      Untitled5
  14. You should see your new AVD listed when you’re back at the Android Virtual Device Manager page.  To test it, select it from the list and then press the ‘Start…’ button.
  15. If all goes well, you should have your hardware accelerated AVD emulator.   You should notice that the emulator runs orders of magnitude faster than the standard emulator!

 

Common problems:

I had the problem where this message appeared when I tried to run the emulator.

emulator: Failed to open the HAX device!
HAX is not working and emulator runs in emulation mode
emulator: Open HAX device failed

To fix this, I tried a number of things that didn’t work, but manually installing HAXM fixed it:

  1. Close Eclipse and Eclipse SDK manager, but still make sure you’ve got the Extras->HAXM installed in the Eclipse SDK Manager (as you did in step 3 above).
  2. Go to the Intel HAXM download page:
    http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/
  3. Run the install package to the normal locations.
  4. Restart Eclipse and see if you can run the emulator via going to ‘Run’->’Run configurations’.  This time it worked for me.  You should see something like this from the message window if your HAXM is running in hardware accelerated mode.
Starting emulator for AVD 'ARM-HAXM'
emulator: device fd:756
HAX is working and emulator runs in fast virt mode
creating window 0 0 480 800

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.