Speedier Android Emulator Preview Now Available (Hallelujah!)
Well, my holiday present arrived early: The promised preview of a speedier Android emulator is now available.
While the Android Studio 2.0 preview was made available in November, the emulator part was delayed until yesterday's release of Android Studio 2.0 Preview 3.
It's about time. There's just no way to quantify or qualify the immense frustration suffered by thousands of Android developers who have been forced to use the slowest software ever conceived: the emulator running on Windows.
Complaints on coding sites like StackOverflow abound, with one classic question ("Why is the Android emulator so slow? How can we speed up the Android emulator?") receiving 2,088 votes (that's a LOT). A theme common to many of these questions is just plain dumbfoundedness on how long the emulator takes to even load, much less do something. It's like: "I've been waiting [20, 30, ?] minutes now. How do I tell if it's working?"
I've been there. Numerous times I've thought: "Well, it must be frozen, better try again." Only to exit out and try again, maybe close the IDE and restart, maybe even shut down the PC and restart -- only to see the same thing happen again, prompting staggering disbelief at the time and effort needed just to see how that latest tiny tweak on the UI is working out.
Well, supposedly (I haven't had time to check it out personally yet), salvation is at hand, according to a blog post published yesterday by product manager Jamal Eason.
"When emulating the latest Android 6.0 release (Marshmallow), we now support Symmetric Multi-Processing (SMP) and have made significant I/O improvements in both the emulator and ADB. This means you will have faster performance when you are testing your app."
Wow. I'm not even going to question how multi-processor support is just now being introduced (haven't multi-processor, multi-core smartphones been around for a while now?). I'm just thankful. (To be fair, there a lot of thorny technical issues involved with SMP on Android that you can learn about here.) I simply concur with the thoughts of Trevor Mack, who said in a Google+ post yesterday: "Android Studio 2.0 Preview 3 includes new Emulator announced that we all have been anxiously waiting for."
Eason detailed performance improvements for both CPUs and the Android Debug Bridge (ADB) that communicates with emulator instances.
"Android Studio now uses CPU acceleration on x86 emulator system images by default," he said. "Combined with new Symmetric Multi-Processor (SMP) support in Android 6.0 Marshmallow system images, the Android emulators can perform even faster than many physical Android devices. Multi-core support not only makes your apps and the emulator run faster but it provides the added advantage of speeding up common developer tasks such as installing APKs. Also, with SMP you can test apps that specifically target multi-processor Android devices."
Regarding the ADB, Eason said under-the-hood improvements now let developers push files across the bridge up to 5x faster than a physical device.
The emulator UI has also been upgraded, Eason said, with a new toolbar and control panel to augment command-line options; window zooming and scaling; drag-and-drop functionality for installing APK files or moving any files to the emulator's SD card storage; and extended UI controls for testing functionality such as phone calls, sending SMS messages, using GPS and more;
Eason said the team will continue to add functionality and features.
"This is just the beginning of developments on the Android Emulator, so expect more features such as support more APIs levels, and adding more sensors with future versions of Android Studio," he said. "The new emulator along with Android Studio are available today on the Android Studio canary channel and tools preview channel."
If you're interested, the Android dev team has published instructions about how to set up the emulator preview.
So go forth, emulate and enjoy. No more firing up the emulator to see how that new menu works and going out to finish that addition to your house while you wait.
Posted by David Ramel on December 11, 2015 at 9:27 AM