Monday, August 31, 2015

Install Intel x86 Emulator Accelerator (HAXM), on Android Studio/Windows 10

After Install Android Studio on Windows 10, you can install Intel x86 Emulator Accelerator (HAXM).

Refer to Android Developers document "Using the Emulator - Configuring Virtual Machine Acceleration":

Many modern CPUs provide extensions for running virtual machines (VMs) more efficiently. Taking advantage of these extensions with the Android emulator requires some additional configuration of your development system, but can significantly improve the execution speed. Before attempting to use this type of acceleration, you should first determine if your development system’s CPU supports one of the following virtualization extensions technologies:
  • Intel Virtualization Technology (VT, VT-x, vmx) extensions
  • AMD Virtualization (AMD-V, SVM) extensions (only supported for Linux)
The specifications from the manufacturer of your CPU should indicate if it supports virtualization extensions. If your CPU does not support one of these virtualization technologies, then you cannot use virtual machine acceleration.

If your system with Intel's CPU, you can check if the Virtualization Technology is Enabled using Intel® Processor Identification Utility.

To install Intel x86 Emulator Accelerator (HAXM Installer) and run it, read this video.

Most probably, you will encounter the following error and the Android Emulator cannot run!

HAXM is not working and emulator runs in emulation mode
emulator: The memory needed by this AVD exceeds the max specified in your HAXM configuration.
emulator: AVD      RAM size = 1536 MB
emulator: HAXM max RAM size = 512 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM configuration to run in fast virt mode.

Because The HAXM installer suggested a 512MB/1GB RAM by default, and the default AVD created by Android Studio Setup require 1536 MB. To fix it, edit your AVD to require 1GB of RAM.

Or, you can/have to re-install HAXM to increase HAXM max RAM size.

No comments: