Boost your Android Emulator performance on linux | Speeding up Android Emulator on Ubuntu

I have started learning Android programming since 5-6 days. I am using ADT Bundle 64-bit running on 64-bit system with Ubuntu 13.04. Starting Android Virtual Device (emulator) was more painful to work for me because of its slow performance. I was very unhappy with the performance but i found that using Intel® Hardware Accelerated Execution Manager(Intel® HAXM for windows and MAX OS X) or Kernal based Virtual Machine(KVM for linux) can solve the problem. And successfully Intel KVM has boost my android emulator performance. Testing and debugging of my android application is now very fast and easy and i don’t need to sit down and wait for emulator startup.

So i am going to explain about speeding your Android Emulator on Linux platform Only. Make sure you have Latest computer with an Intel® processor that has Intel Virtualization Technology enabled.

Note:The steps is carried out with 64-bit Ubuntu 13.04.

Installing On linux:
Make sure you have properly install Android SDK or have ADT Bundle that has both IDE an SDK. Since Intel® HAXM is not compatible with linux we need KVM instead.

Make sure you have latest repository or use the command

sudo apt-get update

Make sure your CPU support hardware virtualization for KVM to run and install. Use the following command

egrep -c '(vmx|svm)' /proc/cpuinfo

cpuinfo

If the result is 1 or more then congrats! you can move forward but if the result is 0 then the CPU doesn’t support Hardware Virtualization.

Check if your processor supports KVM or not by the following command

kvm-ok

if the output is as follow then you are good to go.

INFO: /dev/kvm exists
KVM acceleration can be used

kvmcheck

Else you’ll see the message that “KVM is disabled by your BIOS” In that case you need to enable Intel VT from BIOS.

Now install KVM and related packages by using the command

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

After Installation of KVM and related packages you need to add your user to the KVM and libvirtd group

sudo adduser [username] kvm
sudo adduser [username] libvirtd

Now logout the user and login to make change the effect.

Create Android Emulator:
Now its time to create Android emulator that has hardware accelerated emulation which is our main goal.

Open SDK manager manually or use command

android sdk

sdkandroid

Make sure that you have installed Intel X86 Atom System Image, if not install now from your android SDk manager before creating emulator.

installSDK

After installation you can crete Android Virtual device that has hardware accelerated emulation.
Open AVD Manager manually or use command

android avd

avdandroid

Create new device

androidavdstart
AVD name:
Device:
Target:
CPU/ABI: make sure you choose Intel Atom (X86)
Enable GPU emulation/ Host GPU
Choose appropriate memory and others requirements.

Virtual device

And now click the create AVD button to create the device.
Now you can start the device and check the performance.

emulator

Now go to About Phone inside setting you’ll see Model number Android SDK build for X86

modelnumber

If you have any trouble while performing the above steps please feel free to write in comment. For more information you can visit intel website.

 

 

  • John

    Thanks for the instruction,

    On a 64-bit 14.04 LTS ubuntu, Does the KVM acceleration work on ‘Intel X86_64 Atom System Image‘ too or only a X86 one?

    I’ve read several instructions and all of them just had mentioned X86 not X86_64 image while I have both in SDK manager list available to download.

    for instance: https://stackoverflow.com/a/27071235/190929

  • Kevin Arrieta

    Thank you, very useful!

  • Zain Ulabidin

    It works !

Pinterest
Email
Print