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
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
if the output is as follow then you are good to go.
INFO: /dev/kvm exists
KVM acceleration can be used
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
Make sure that you have installed Intel X86 Atom System Image, if not install now from your android SDk manager before creating emulator.
After installation you can crete Android Virtual device that has hardware accelerated emulation.
Open AVD Manager manually or use command
Create new device
CPU/ABI: make sure you choose Intel Atom (X86)
Enable GPU emulation/ Host GPU
Choose appropriate memory and others requirements.
And now click the create AVD button to create the device.
Now you can start the device and check the performance.
Now go to About Phone inside setting you’ll see Model number Android SDK build for X86
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.