The great thing about emulators are they allow you to test devices with different screen sizes and resolutions from your desktop without actually having to buy a physical device.
The problem is the built-in Android emulator is painfully slow and a lot of your time can be taken up just waiting for it to load up and respond to commands. Here are a few tricks which can help speed things up:
Know how to create a new device using the Android Virtual Device Manager
Currently the graphics are processed by the devices limited CPU. You can speed things up by handing over this work to your host machines GPU - this not only improves the graphics but also frees up some much needed processing power for other parts of your app.
The solution is simple: when creating or amending a device simply check ‘use Host GPU’.
The delegating of graphics processing does help but only marginally. The next thing we can do is to our host CPU which has Virtual Machine acceleration features instead of the Virtual Machine's ARM CPU one which is slower.
Using a host running OS X with an Intel chip.
Here's what to do: Open up the Android SDK manager and install the Intel x86 Atom System Image for whichever Android APIs you wish to test your app on.
Next install the Intel Hardware Accelerated Execution Manager (HAXM) which allows faster Android emulation when on their chips Note: For OS X 10.9 (Mavericks) users there is a bug which means the automatic installation of HAXM does not work. Skip down to the next section to see how to do it manually!
If all has gone well then you're ready to test out your accelerated emulator!
This is the equivalent of doing it through the Android SDK manager, once installed you'll be ready to test it out!
Head on back to the Android Virtual Device Manager and when creating or amending a virtual device you should now be able to select ‘Intel Atom (x86)’ as an option for whichever Target you installed the CPU image for.
Fire it up and test out your new accelerated emulator!
This article was originally written for Brightec by Andy Hails
Search over 400 blog posts from our team
Subscribe to our monthly digest of blogs to stay in the loop and come with us on our journey to make things better!