Android Emulator Slow

  1. Android Emulator Slow Screen
  2. Android Emulator Slow Startup
  3. Android Emulator Slow Down
  4. Android Emulator Slows Down Pc
  5. Android Emulator Slow

Android emulators can be a bit slow and when I say slow, I mean REALLY slow. This article attempts to cover a two of the most prominent issues when using an Android emulator with Xamarin. Its speed and how buggy the debugging can be. If that makes sense. :/

So you're using Xamarin to build an app and all of a sudden, one day, out of the blue, like Xamarin just decided to hate you, it get's stuck on Starting emulator... or it just takes AGES to start debugging, chances are you're running your emulator with a virtual ARM CPU, yup... Slow.

Android emulator slow pc

Testing on multiple mobile devices is costly, time consuming and the default Android emulator is notoriously slow. So, what should we do? That's easy - start using a properly fast Android emulator. When developing Android applications, you have to keep in mind all the different Android OS versions and various screen sizes and resolutions. Android emulator is dead slow. It takes 800MB memory while running. If you are on Windows, You can use Microsoft Android Emulator. It is superb, provides you functionalities more than Android Studio Emulator. And most important it is fast ( consumes 13MB only). It comes with Visual Studio 2015 Technical Preview. I am using it and happy with it. Memu is a great Android emulator for low end PC. This emulator allows users to access advanced options. It comes with a root function along with a toolbar. Also supports keyboard, mouse and a gamepad for gaming. This android emulator gives good performance in games, so if you are looking for gaming it would be a nice option for you.

Slow

Solving the slow AVD and buggy integration between Xamarin and AVD:

To solve the issues, you'll need to change your virtual device from an ARM CPU to an Intel Atom, to do this, click the icon in the toolbar that looks like a phone with a play button over it, like so:

This will open up the Android Virtual Device Manager and within it, you should have a list of virtual devices that Xamarin can use to debug Android apps within, we're going to want to change one of these to an Intel Atom CPU, as you can see below, I've already changed one of mine so you can see the difference within the AVD.

Note: You may notice that none of my virtual devices names contain spaces, this is because there was a known issue with the virtual names containing spaces and Xamarins ability to use them to debug so this might be worth a thought if you run into this issue.

Now you'll need to click one of the devices in the list and then click the Edit... button, this will allow you to change the device name and configuration. You should now have been presented with a new window that looks like this:

So if you wanted to change the name, now is the time to do it, just update the text within the AVD Name field.

You'll now need to choose the Intel CPU from the CPU/ABI dropdown, just click it and choose Intel Atom (x86), now you'll need to change the VM Heap to 256 and give your device more ram if required. I tend to allow 2048.

Android Emulator Slow

Note: When Use Host GPU is checked, you cannot also have Snapshot checked.

If you want to speed up rendering, make sure that the Use Host GPU checkbox is checked.

Now click OK and you'll be presented with another window with the heading Result of creating AVD, click OK on that too as this window is just informational.

Making sure the final bits are installed:

Android Emulator Slow Screen

In order to correctly emulate an Intel Atom CPU, you'll need to install Intel HAXM, just scroll down on the page, click to download the zip, agree with the terms, wait for it to download, extract it and install leaving all the settings default.

Chances are the AVD will now work, but if you have Hyper V running, you'll need to turn that off so that the Intel Virtualisation can run correctly, simply open up CMD with administrative rights and run the following command and when it's done, reboot:

That's it, you're good to go and your Android Virtual devices should now run at least x10 faster and Xamarin should deploy apps to it with ease.

Xamarin won't launch your app?

Your app might crash on startup with the error 'android emulator shared runtime initialization error' despite the virtual device now running very quick. This can be caused by the change in CPU on the virtual device, put simply, Xamarin uses a shared mono runtime to run its apps in debug, this is installed the first time you debug a Xamarin app, however if the device CPU changes, the binaries are now incompatible.

To solve this issue, uninstall Mono Shared Runtime and Xamarin Android API support from the Apps section within Settings, then simply Clicking play within Visual Studio will re-install both of these and your app should boot up as expected without issue.

Summary.

You can speed up Android Virtual Devices by swapping from an ARM CPU to an Intel Atom CPU.

A faster AVD will allow Xamarin to make requests of it in a timely fashion solving some issues.

Intel HAXM is required to emulate an Intel Atom CPU.

Mono runtime will need to be reinstalled.


By Luke Alderton

Published at 21 Jul 2016, 10:02 AM

Tags: Android,Xamarin

Comments

Sit tight...
We're adding your comment.
There's been a problem.
Please try again later.
Emulator

In last tutorial, I shared the installation steps for Android ADT toolkit in windows machine. Then we learnt about creating the AVD (virtual devices or emulators) and we deployed our hello world app onto emulator. One thing you must have noticed that emulators are dead slow by default. I mean they are so much slow that you can take your lunch in the mean time and they will be loading all the time. Can we improve this slow emulators? Ye, we can. Let’s see how.

Speed up a slow android emulator

Step 1) Download HAXM Driver using SDK Manager

To improve the performance of an emulator first thing you will need is installing the “Intel Hardware Accelerated Execution Manager Driver” from SDK Manager you get with Android ADT. Look at the screen shot below.

Step 2) Execute IntelHaxm.exe to install the HAXM driver

This will create the IntelHaxm.exe inside “extra” folder in your android ADT package. Execute this file to install the HAXM Driver which is responsible for virtualization in your system.

Step 3) Update BIOS if driver installation failed

Android Emulator Slow Startup

There are chances that above installation process failed and you are advised to update the BIOS configuration related to “Intel Virtualization Technology“. Go ahead and do it. For related information to this step, read the manual received with motherboard when you purchased it.

Generally, when you go to BIOS options by pressing “DEL” key during boot process, you can easily find the menu option “Intel Virtualization Technology” in third tab. Enable this option and restart the machine.

Android Emulator Slow Down

Step 4) Use Host GPU Option

Once Virtualization Technology is enabled, you can use this feature while creating the Emulator by checking the checkbox “Use Host GPU“. This will enable the system’s native support for virtualization for emulator.

Android Emulator Slows Down Pc

Emulator

Step 5) Test the configuration changes

Now start the emulator and see the major performance gain you obtained using above steps.

Android Emulator Slow

Happy Learning !!