How to speed up the Android emulator?

You can now enable the Quick Boot option for Android Emulator. That will save the emulator state, and it will start the emulator quickly on the next boot.

Click on the Emulator edit button, then click Show Advanced Setting. Then enable Quick Boot like the below screenshot.

Quick boot

Android Development Tools (ADT) 9.0.0 (or later) has a feature that allows you to save the state of the AVD (emulator), and you can start your emulator instantly. You have to enable this feature while creating a new AVD or you can just create it later by editing the AVD.

Also, I have increased the Device RAM Size to 1024 which results in a very fast emulator.

Refer to the given below screenshots for more information.

Creating a new AVD with the save snapshot feature.

Android emulator with save snapshot feature.

Launching the emulator from the snapshot.

Launching the emulator from the snapshot.

Using an SSD hard drive has too much impact and I recommend using a more suitable ram (8 or higher).

Answer #2:

IMPORTANT NOTE: Please first refer to the Intel list about VT to make sure your CPU supports Intel VT.

HAXM Speeds Up the Slow Android Emulator

HAXM stands for – “Intel Hardware Accelerated Execution Manager”

Currently, it supports only Intel® VT (Intel Virtualization Technology).

The Android emulator is based on QEMU. The interface between QEMU and the HAXM driver on the host system is designed to be vendor-agnostic.

HAXM

Steps for Configuring Your Android Development Environment for HAXM

  1. Update Eclipse: Make sure your Eclipse installation and the ADT plug-in are fully up-to-date.
  2. Update your Android Tools: After each Eclipse plug-in update, it is important to update your Android SDK Tools. To do this, launch the Android SDK Manager and update all the Android SDK components. To take advantage of HAXM, you must be on at least release version 17.
Enter image description here
  • Download the x86 Atom System Images and the Intel Hardware Accelerated Execution Manager Driver. Follow the image below:
Enter image description here
  • Install the HAXM Driver by running “IntelHaxm.exe”. It will be located in one of the following locations:
    • C:\Program Files\Android\android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager
    • C:\Users\<user>\adt-bundle-windows-x86_64\sdk\extras\intel\Hardware_Accelerated_Execution_ManagerIf the installer fails with the message that Intel VT must be turned on, you need to enable this in the BIOS. See the description for how to do this in Enabling Intel VT (Virtualization Technology) .
Install .exe or .dmg
  • Create a new x86 AVD: Follow the image below:
Create AVD
  • Or as for new SDK,

 Enter image description here

How to supercharge the slow Android emulator?- Answer #3:

Try Android x86. It’s much faster than the Google Android emulator. Follow these steps:

  1. Install VirtualBox.
  2. Download the ISO file that you need.
  3. Create a virtual machine as Linux 2.6/Other Linux, 512 MB RAM, HD 2 GB. Network: PCnet-Fast III, attached to NAT. You can also use a bridged adapter, but you need a DHCP server in your environment.
  4. Install Android x86 on the emulator, run it.
  5. Press Alt+F1, type netcfg, remember the IP address, press Alt+F7.
  6. Run cmd on your Windows XP system, change the directory to your Android tools directory, type adb connect <virtual_machine_IP>.
  7. Start Eclipse, open the ADT plugin, find the device, and enjoy!

Method to make android emulator faster- Answer #4:

GPU Emulation

GPU emulation (sometimes referred to as GPU acceleration) is where the emulator utilizes the host machine’s GPU to accelerate drawing options. This can make the emulator run much faster.

GPU Emulation is turned off by default, so you need to enable it whenever you launch an AVD. Although ‘Use Host GPU’ used to appear in the AVD Manager, this option isn’t currently available in Android Studio, but the good news is you can still enable GPU emulation if you launch an AVD from the command line.

To launch your AVD with GPU emulation enabled, create the AVD you want to use as normal. In this example, I’m going to create an imaginatively-named myemulator AVD.

Open your Mac’s Terminal (or Command Prompt, if you’re a Windows user) and then ‘change directory’ so the Terminal is pointing at Android SDK’s ‘Tools’ folder. My command looks like this:

cd /Users/yourusername/Library/Android/sdk/tools

Next, launch the emulator you created (myemulator) with the -gpu on flag, for example:

./emulator @myemulator -gpu on

The AVD will launch with graphics acceleration enabled. Spend some time interacting with the AVD, and you should notice a speed improvement.

Answer #5:

~50% faster

Windows:

  • Install “Intel x86 Emulator Accelerator (HAXM)” => SDK-Manager/Extras
  • Install “Intel x86 Atom System Images” => SDK-Manager/Android 2.3.3
  • Go to the Android SDK root folder and navigate to extras\intel\Hardware_Accelerated_Execution_Manager. Execute file IntelHaxm.exe to install. (in Android Studio you can navigate to: Settings -> Android SDK -> SDK Tools -> Intel x86 Emulator Accelerator (HAXM installer))
  • Create AVD with “Intel atom x86” CPU/ABI
  • Run emulator and check in console that HAXM running (open a Command Prompt window and execute the command: sc query intelhaxm)
enter image description here

Also, don’t forget to install this one

enter image description here

P.S. during AVD creation add emulation memory: Hardware/New/Device ram size/set up value 512 or more

Linux:

  • Install KVM: open GOOGLE, write “kvm installation “
  • Create AVD with “Intel atom x86” CPU/ABI
  • Run from command line: emulator -avd avd_name -qemu -m 512 -enable-kvm
  • Or run from Eclipse: Run/Run Configurations/Tab “Target” – > check Intel x86 AVD and in “Additional Emulator Command Line Options” window add: -qemu -m 512 -enable-kvm (click Run)
enter image description here

OS-X:

  • In Android SDK Manager, install Intel x86 Atom System Image
  • In Android SDK Manager, install Intel x86 Emulator Accelerator (HAXM)
  • In finder, go to the install location of the Intel Emulator Accelerator and install IntelHAXM (open the dmg and run the installation). You can find the location by placing your mouse over the Emulator Accelerator entry in the SDK Manager.
  • Create or update an AVD and specify Intel Atom x86 as the CPU. Intel x86 Emulator Accelerator (HAXM) showing Location

Another explanation and solution is here:

The emulator is slow because it emulates an ARM CPU, which requires translation to Intel opcodes. This virtualization chews up the CPU.

To make the emulator faster, you have to give it more CPU. Start with a fast CPU or upgrade if you can.

Then, give the emulator more of the CPU you have:

  1. Disable Hyperthreading – Since the emulator doesn’t appear to utilize more than one core, hyperthreading actually reduces the amount of overall CPU time the emulator will get. Disabling HT will slow down apps that take advantage of multiple CPUs. Hyperthreading must be disabled in your BIOS.
  2. Make the emulator run on a CPU other than CPU 0 – This has a much smaller impact than turning off HT, but it helps some. On Windows, you can specify which CPU a process will run on. Many apps will chew up CPU 0, and by default the emulator runs on CPU 0. I change the emulator to run on the last one. Note that on OS X you cannot set affinity.

I’m seeing somewhere around a 50% improvement with these two changes in place.

To set processor affinity on Windows 7:

  1. Open Task Manager
  2. Click View All Processes (to run as administrator, otherwise you can’t set processor affinity)
  3. Right click on emulator.exe and choose Set Affinity…
  4. On the Set Affinity dialog, select just the last CPU

Note: When you change affinity in this way, it’s only changed for the lifetime of the process. Next start, you have to do it again.

enter image description here

Hope you learned something from this post.

Follow Programming Articles for more!

About ᴾᴿᴼᵍʳᵃᵐᵐᵉʳ

Linux and Python enthusiast, in love with open source since 2014, Writer at programming-articles.com, India.

View all posts by ᴾᴿᴼᵍʳᵃᵐᵐᵉʳ →