Macos Android Emulator Slow

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. The main objective before releasing an application is to find bugs and design imperfections.

Default Android emulator

A GitHub Action for installing, configuring and running hardware-accelerated Android Emulators on macOS virtual machines. The old ARM-based emulators were slow and are no longer supported by Google. The modern Intel Atom (x86 and x8664) emulators require hardware acceleration (HAXM on Mac & Windows. What Is Android? Android is a Linux based Operating System (OS) that is open source and is used for mobile platforms like smartphones, tablets, etc. Android is a preferred OS because of the features like open-source, large developer and community reach, increased marketing, inter-app integration, reduced cost of development, higher success ratio, rich development environment, etc.

The great thing about using an emulator for development is that it gives you an opportunity to develop applications without having a real Android device. The default Android emulator comes together with the Android SDK and can be found in the 'tools' folder.

Macos Android Emulator Slow

So far so good, we have our cake, but can we eat it? The answer comes about 5 minutes after we hit the 'Launch' button. Go grab a coffee. Have breakfast. Come back. Wait another 5 minutes. Maybe even more.

Finally - the emulator launches, only to show how slow it actually is.

All these performance problems stem from the fact that it emulates an ARM processor so it can run the actual code of your application. It accomplishes that by providing dynamic binary translation of the device machine code to the OS and processor architecture of your development machine.

Basically, it does a lot of mumbo-jumbo to pretend it's an ARM processor - when actually it isn't.

OK, it's slow. So what can we do about it?

  • Well, first, we can help our CPU out by delegating the rendering process to the GPU by checking 'Use Host GPU' checkbox in AVD's edit window. The screen should now look better and be more responsive. That's because the CPU is not dealing with the tedious work of doing rendering anymore. But, that's still not fast enough.
  • We can download Intel Atom (x86) images and, while we're at it, download Intel x86 Emulator Accelerator (HAXM, for Mac and Windows only). This will enable virtual machine acceleration capabilities of the Intel CPU (for more information check this link).

Now we're getting somewhere, once this baby starts up, it should run fast and smooth.

You could say that this level of speed should be sufficient. That may be true, but an issue with the Intel x86 images is that you don't get Google Apps, they only come with ARM images. This is important if you're testing an app that uses GMaps, or Google Play Services.

So, as we've seen, ARM images aren't fast enough even with hardware acceleration. And emulators don't have the Play Store. What now?

Genymotion by Genymobile

Genymotion is a new, fast Android emulator developed by the French company Genymobile. It's based on the open-source project AndroVM, and the first beta version was released back in June.

It runs on all major platforms (Mac, Windows, Linux). For now it's freely available, but there is also going to be a paid version.

According to AndroVM blog, the free version will be feature-rich, and the paid version will be intended for large companies needing a higher level of collaboration on Genymotion.

How to use it?

Genymotion relies on Oracle VirtualBox to work (version 4.1 or above). So...

  1. Download and install VirtualBox. For Windows users it's not necessary to install VirtualBox separately, because it is available from the Genymotion site, bundled with the Genymotion emulator.

  2. Go to Genymotion website and sign up. You'll receive a validation mail, so just click on the validation link to proceed.

  3. Download and install the Genymotion emulator (the current version is 1.1.0).

  4. Start Genymotion. You might need to configure path to your Android SDK location in Genymotion settings (probably if you've installed SDK in a non default location). Since this is a first start, there are no devices. Click on 'Add' and download new device. To see available devices, write your credentials in the pop-up dialog and click 'Connect'.

  5. Select the device and click 'Start'.

Xamarin Android Emulator Slow

It starts quickly and is insanely fast! It's a little awkward to start the emulator separately, but Genymotion provides Eclipse and Android Studio integration through plugins, also available on Genymotion website. To use the plugin, you have to provide a path to Genymotion installation and Android SDK, as well.

OK, it's fast. Is that it?

Well, for me, the sheer speed of Genymotion is what got me using it in the first place. Which is kind of funny, because in the first version you couldn't even rotate the device.

But, alongside the speed bump, it also provides GPS, compass and battery control via some good-looking widgets.

Battery control widget

The GPS widget even provides GMaps for selecting mock locations, which is really nice for testing location based apps.

Responding

Device angle control and Play Store

Through the Genymotion shell it's also possible to control the device's angle (accelerometer), but it would be cool to control it using a widget, something like the Windows phone emulator does.

Genymotion devices with Google Apps also come with the Play Store preinstalled. This comes in handy if you want to test an app from the Play Store quickly.

Multiple screen sizes

Multiple screen sizes are one of Android developer's worst nightmares. There is a huge number of different screen configurations of Android devices.

Genymotion, as well as the default emulator, offers custom configuration of device's screen. In the list of available devices, select the device for which you want to change screen configuration and click on the monitor icon on the right side. Then simply select one of the predefined screen resolutions or create your own.

Be careful when choosing resolution, because you may end up with something rather strangeā€¦

Where it comes short

The main setback of Genymotion is that it only provides devices with API version 16, 17 and a preview version of Android 4.3 (API 18). If we take a look at Google Dashboard, we'll see that Gingerbread still holds about 33% of all devices (API 10).

So, for testing on that platform you still need either a default emulator or real device, which kind of defeats the purpose of Genymotion as a testing platform.

And there is no camera, which I don't miss, but could be really useful.

In the future, we can expect even more features, like taking screenshots or video screen capturing (which would be great for making demonstration videos). An accelerometer widget would be cool, and even a camera would be nice, but we can only wait and see.

Final thoughts

Well, you can never really get rid of real devices, because you'll always want to test an app on a real device before releasing it. But during development I recommend using a Genymotion emulator. Even though it doesn't cover all major Android OS versions. It's fast, stable, the GPS sensor manipulation is awesome and with the device rotation feature added to the 1.1.0 version - it's truly the way to go.

Also, deploying apps is almost instant and that can save you a lot of time when you're doing small changes to the app. But you have to watch out since the Genymotion emulator runs faster than real devices themselves, giving you a false impression of the performance of the app.

Always test on a real device!

Like this article? Sign up for our monthly newsletter and never miss any of them.

This page lists known issues, workarounds, and troubleshooting tips for theAndroid Emulator.

If you encounter an issue not listed here or are unable to successfully use aworkaround listed here, please report a bug.

Mac Os Android Emulator Slow Screen

Checking for adequate disk space

To avoid crashes and hangs caused by not having enough free disk space, theemulator checks for sufficient free disk space on startup, and will not startunless at least 2 GB is free. If the emulator fails to start for you, check tosee that you have adequate free disk space.

Antivirus software

Because many security and antivirus software packages work by monitoring everyread and write operation, use of such software can decrease performance of toolslike the Android Emulator.

Many antivirus packages provide the ability to add specific applications to alist of trusted applications, which enables these applications to operatewithout performance degradation. If you are experiencing poor performance withsaving or loading of AVD snapshots, you may improve this performance by addingthe Android Emulator application as a trusted application in your antivirussoftware.

The performance impact differs between various antivirus software packages. Ifyou have additional antivirus software installed beyond that which is includedwith your operating system, you can run simple tests to determine whichantivirus software has a greater performance effect on emulator load and saveoperations.

Some antivirus software may be incompatible with the Android Emulator.

If you're using Avast software and are having trouble running the AndroidEmulator, try disabling Use nested virtualization when availableand Enable Hardware assisted virtualization in the Avast Troubleshootingsettings. In addition, after Avast hardware virtualization is disabled, ensurethat HAXM is set up properly again with a full re-installation of the latest HAXMfrom the SDK Manager.

HAXM on older, unsupported versions of Mac OS

If you are using Android Emulator on older, unsupported versions of Mac OS X(such as 10.9), then you may need to use an older version of HAXM (6.1.2), too.

Android Emulator runs slowly after an update

Android Studio Emulator Slow

A number of external factors can cause the Android Emulator to begin runningslowly after an update. To begin troubleshooting, we recommend thefollowing steps:

  • If you are running Android Emulator on Windows, check to see if you haveinstalled Windows UpdatesKB4013429andKB4015217.Some users reported improved Android Emulator performance after uninstallingthese updates. Users also reported improved Emulator performance afterinstalling Windows UpdateKB4015438.
  • If you have an Intel GPU (and in particular, the Intel HD 4000), ensure youhave downloaded and installed the latest Intel graphics driver.
  • If your machine has both an Intel HD 4000 GPU and a discrete GPU,disable the Intel HD 4000 GPU in Device Manager to ensure you areusing the discrete GPU.
  • Try running the emulator using the -gpu angle, -gpu swiftshader, or-gpu guest modes. For more information about configuring graphicsacceleration options on the command line, seeConfigure hardware acceleration.
  • Ensure that your router is not using IPv6 addresses if you do not have anIPv6 connection.

If you are still experiencing problems with the Android Emulator runningslowly, Report a bug, including thenecessary Android Emulator Details so we can investigate.

Bluestacks Android Emulator For Pc

Windows: Free RAM and commit charge

When the emulator starts, it needs to initialize the Android guest operatingsystem's RAM. On Windows, the emulator asks Windows to account for the fullsize of guest memory at start time, even though during actual operation, thememory may be paged in on demand. The emulator requests the full amount of guestmemory at start time because Windows is conservative in ensuring that there isenough physical RAM and pagefile available to hold the entire potential workingset; this prepares for the worst case, in which all guest memory is touchedquickly, without any opportunity to discard or otherwise free memory.

Sometimes, when the emulator asks Windows to account for this full guest memorysize, the request exceeds the current commit limit, which is the total of theavailable physical RAM and pagefile. In this case, Windows can't guarantee thatthe worst-case working set will fit in either physical RAM or pagefile, and theemulator fails to start.

In typical cases, the amount of hard drive space allocated for the pagefile plusphysical RAM is more than enough for most use cases of the emulator. However, ifyou experience failures to start the emulator because of exceeding the commitlimit, we recommend examining the current commit charge, which can be seen inthe Performance tab in the Windows Task Manager. (To open the Task Manager,press Ctrl+Shift+Esc.)

Slow

You can lower the likelihood of exceeding the commit limit in various ways:

Android Emulator For Slow Pc

  • Free physical RAM before launching the emulator by closing unused applicationsand files.
  • Disable third-party memory management and memory compression utilities. Theseutilities can inefficiently cause an excess commit charge and bring yoursystem closer to the commit limit.
  • Use a system managed size for the Windows pagefile, which can more flexiblyand dynamically increase the pagefile size (and therefore the commit limit) inresponse to increased demand from the emulator and other applications.

    For more information on commit charges and why a flexible setting works best,see this Microsoft article.

Comments are closed.