VISUAL STUDIO   Windows Mac

Accelerating Android Emulators with HAXM

PDF for offline use

Let us know how you feel about this

Translation Quality


0/250

last updated: 2017-03

This guide explains how to install and configure the Intel Hardware Accelerated Execution Manager (HAXM) to make the Google Android Emulator run faster.

Overview

Without hardware acceleration, the Google Android Emulators are prohibitively slow. To improve Android emulation performance, you can install the Intel HAXM Drivers. The Intel Hardware Accelerated Execution Manager (HAXM) Drivers provide hardware acceleration for x86 based Android SDK emulators on Intel VT-enabled sytems. The HAXM drivers, published by Intel, are free to use.

Intel HAXM drivers are installed automatically by Xamarin Studio 6.0 (or later). However, if you are using an earlier version of Xamarin Studio, you must install HAXM manually. This guide provides detailed information about how to install and configure the Intel HAXM drivers to make the Google Android Emulator run faster. If you plan to exclusively use the Google emulators, you should install these drivers.

Intel HAXM drivers are installed automatically by and Xamarin for Visual Studio 4.1 (or later). However, if you are using an earlier version of Xamarin for Visual Studio, you must install HAXM manually. This guide provides detailed information about how to install and configure the Intel HAXM drivers to make the Google Android Emulator run faster. If you plan to exclusively use the Google emulators, you should install these drivers.

Setting Up Your Google Android Emulator with HAXM

  1. Launch Xamarin Studio.

  2. Click Tools > Open Android SDK Manager:

    Open Android SDK Manager

  3. In the SDK Manager, make sure you have installed the x86 Atom System Image for the desired Android SDK version. If needed, select it and install the package, agreeing to the license as needed. The image will download and install:

    Install Intel x86 Atom image

    At this point, you can build x86 Android Virtual Device versions by selecting the appropriate CPU/ABI choice when creating the device, but they will not be accelerated. If you have any Android Virtual Devices running, close them before continuing.

  4. From the Intel website, download the latest HAXM virtualization engine. If you are running Mac OS X 10.9 Mavericks, you will want the appropriate hotfix version that corrects issues on these systems. While the links appear to have been temporarily removed, they are still accessible directly from the original link: HAXM hotfix for OS X 10.9.

  5. Install the HAXM engine, following along with the dialogs:

    HAXM installer dialog

  6. If you haven't already created an x86 Android Virtual Device, do so now from the Android Virtual Device Manager (accessible in Xamarin Studio from the Tools menu by selecting Open Android Emulator Manager). Use the following template to create an x86 Android Virtual Device:

    Create an Intel x86-based AVD

  7. After you have a device defined, in the Virtual Device Manager, select it and click Start. Adjust any launch options and launch it. After several seconds, your accelerated Android Virtual Device will be running.

  8. From Xamarin Studio, deploy your project and pick your new x86 emulator device as the target:

    Choose x86 emulator

  9. If you are using Xamarin Studio with Configuration: Debug selected, the ABIs list will be greyed out as shown below and all options (including x86) will automatically be supported. If you are testing a Release configuration, ensure that the x86 checkbox under Options > Build > Android Build > Advanced is ticked.

    Project Options

Now your Android emulator will run much faster! For information about deploying your app to the emulator, see Deploy and Launch an Application.

  1. Launch Visual Studio.

  2. Click Tools > Android > Android SDK Manager.

  3. In the SDK Manager, make sure you have installed the x86 Atom_64 System Image (or x86 Atom if you are using 32-bit Windows) for the desired Android SDK version. If needed, select it and install the package, agreeing to the license as needed. The image will download and install (these screenshots are from Xamarin Studio, but Visual Studio is very similar):

    Install Intel x86 image

    At this point, you can build x86 Android Virtual Device versions by selecting the appropriate CPU/ABI choice when creating the device, but they will not be accelerated. If you have any Android Virtual Devices running, close them before continuing.

  4. From the Intel website, download the latest HAXM virtualization engine. If you are running Windows 8.1, you will want the appropriate hotfix version that corrects issues on these systems. While the links appear to have been temporarily removed, they are still accessible directly from the original link: HAXM hotfix for Windows 8.1.

  5. Install the HAXM engine, following along with the dialogs:

    HAXM Installer Dialog

  6. If you haven't already created an x86 Android Virtual Device, do so now from the Android Virtual Device Manager (accessible from the Tools menu by selecting Android > Android Emulator Manager). Use the following template to create an x86 Android Virtual Device:

    Create an Intel x86-based AVD

  7. After you have a device defined, in the Virtual Device Manager, select it and click Start. Adjust any launch options and launch it. After several seconds, your accelerated Android Virtual Device will be running.

  8. From Visual Studio, deploy your project and pick your new x86 emulator device as the target.

  9. If you are testing a Release configuration, ensure that the x86 checkbox under Properties > Android Build > Advanced is ticked.

Now your Android emulator will run much faster! For information about deploying your app to the emulator, see Deploy and Launch an Application.

Using HAXM and Hyper-V

If you are using Microsoft Hyper-V on your Windows computer (for example, you use Hyper-V for Windows Phone development and HAXM for Android development), you will be unable to use HAXM while Hyper-V is enabled. Intel HAXM and Microsoft Hyper-V cannot both be active at the same time. Unfortunately, there is currently no way to switch between between Hyper-V and HAXM without restarting your computer. However, you can create a multi-boot configuration that allows you to pick which hardware virtualization to use at Windows boot time. When Hyper-V is disabled, HAXM can be used.

Use the following steps to configure your Windows computer so you can selectively enable/disable Hyper-V at Windows start time:

  • Open a command prompt with Administrator privileges and enter the following command:

    bcdedit /copy {current} /d "No Hyper-V"
  • Use the GUID returned in the result of the previous command in this command:

    bcdedit /set <GUID> hypervisorlaunchtype off

Where <GUID> is the GUID returned from the bcdedit /copy command. To illustrate, here is a screenshot of a command session:

Bcdedit session

When you restart Windows, you will get a boot prompt that resembles the following screenshot:

Choose an operating system

Select the No Hyper-V option when you want to use HAXM. Select the other boot option when you want to use Hyper-V.

To remove the No Hyper-V option from the boot menu, use the bcdedit /delete <GUID> command. For example, the following command removes the No Hyper-V boot option created in the previous example:

bcdedit /delete {38f50265-1f62-11e4-802e-cee935cd4cce}

Summary

This guide explained how to improve Android emulation by installing and configuring the Intel Hardware Accelerated Execution Manager (HAXM) to make the Google Android Emulator run faster.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.