For years, Android developers have been struggling with the Android emulator. The emulator was so bad that it was almost impossible to use it. It took ages to start, and even when (or if) it started, it would crash a lot and applications would load forever. That’s why, 2 years ago we switched to Genymontion which is both fast and reliable. We wrote a blog post about it, so if you want you can read it here.
However, Genymotion has a big problem – the lack of support for Google applications. There is no straightforward way to add them to the emulator and you have to do it for every emulator you create.
Luckily, Google listens to developers. As it turns out, their engineers had been working on a brand new Android emulator, that was released to the public a few days ago. I took it for a spin and here’s what it offers:
When you start the emulator, it loads in less than 10 seconds. The first time I started it, I thought I did something wrong. But I didn’t, it actually loads that fast. If you’ve tried out the old Android emulator, then you know that launching it used to take at least several minutes.
The first thing you’ll notice is the new side toolbar which has some default controls. If you click on the three dots, an extended controls window with new features will open.
Fake GPS data points
With the new emulator, you can easily fake users’ movement by importing GPX or KML file. This is a great and easy way to test location-based applications.
Fake cellular connection
Testing different cellular network types has been a real pain until now. Now you can choose between several network types and set the status of voice and data service. If you’ve always wanted to test your application in roaming, on EDGE data connection, now you can do it from the comfort of your chair instead of going to another country.
Changing battery status
You probably noticed that the only way so set the battery level on the old emulator was through the command line. Now you can set several options like charge level, charger connection, battery status, and even battery health. And if you are wondering, like I was, what would happen if you disabled charging and set battery level to 0%, I have an answer for you. The phone shuts down and the emulator closes. Mystery solved.
Call or text yourself
Testing how your app behaves when the user receives a phone call or text is now a lot easier. With new “Phone” options, you can send texts or fake a call from the emulator.
Until now, there has been no way to test fingerprint authentication without a real device. The latest Android emulator allows you to test your app with up to 10 different fingerprints.
Where can I get it?
The new emulator is available only in Android Studio 2.0 Preview 3b and it won’t work as fast as I mentioned if you emulate an ARM processor. You need to emulate an x86 processor if you want to enjoy the awesome performance.
AS 2.0 Preview 3b can be downloaded from the Canary Channel. The Canary Channel delivers bleeding edge updates for Android Studio on an almost weekly basis. In other words, this is far from a stable version and bugs are expected. After downloading, you will have to open the SDK Manager and install two things:
- SDK tool 25-rc1
- Intel x86 Emulator Accelerator
Just one important note: if you are using Mac and you already have Intel x86 Emulator Accelerator installed, you might get an error like this when starting the emulator:
emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable.
To fix this, you have to manually reinstall the x86 Accelerator. You can do this by navigating to this folder:
Open the IntelHAXM_6.0.1.dmg file and reinstall the x86 Accelerator.
After that, you just have to create a new x86 virtual device, press the Run button, sit back and your new emulator will be ready in a few seconds.
Should I say goodbye to Genymotion?
The new emulator is packed with new features and it works really fast, so the question is, do you still need Genymotion? The answer is yes, at least for a few more months. The new Android emulator is still in beta and there are some bugs which will drive you crazy. For example, sometimes setting the user’s location doesn’t work and faking a call freezes the emulator. Also, when the emulator freezes, you have to force close it because pressing the Quit button doesn’t work.
Despite those bugs, the new emulator shows great promise. It’s cool and usable, so I encourage you to try it out.