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.
- Install Eclipse as your normally would
- Open the Eclipse SDK Manager.
- Install one of the latest Android API packages with two important points:
- After those packages are all installed, close the manager and open Eclipse.
- Open a workspace and get an app ready to test (use one of the samples if necessary)
- Go to: Run->Run Configurations
- Right-click ‘Android Application’ on the list on the left and select ‘New’
- I named mine Standard_Run_Configuration – but you can name yours whatever.
- Put the project name in the Project box (mine was AndroidCubeStart)
- Select the ‘Target’ Tab.
- Select the ‘Automatically pick compatible device…” option, then select the ‘Manager’ button.
- At the Manager pane, select ‘New…’
- Fill out the AVD with these notes:
- 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.
- 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!
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:
- 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).
- Go to the Intel HAXM download page:
- Run the install package to the normal locations.
- 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