Appendix C. The Emulator: The Android Emulator

image with no caption

Ever felt like you were spending all your time waiting for the emulator?

There’s no doubt that using the Android emulator is useful. It allows you to see how your app will run on devices other than the physical ones you have access to. But at times it can feel a little... sluggish. In this appendix, we’re going to explain why the emulator can seem slow. Even better, we’ll give you a few tips we’ve learned for speeding it up.

Why the emulator is so slow

When you’re writing Android apps, you’ll spend a lot of time waiting for the Android emulator to start up or deploy your code. Why is that? Why is the Android emulator so sloooooow? If you’ve ever written iPhone code, you will know how fast the iPhone simulator is. If it’s possible for the iPhone, then why not for Android?

There’s a clue in the name: the iPhone Simulator and the Android Emulator.

The iPhone Simulator simulates a device running the iOS operating system. All of the code for iOS is compiled to run natively on the Mac and the iPhone Simulator runs at Mac-native speed. That means it can simulate an iPhone boot-up in just a few seconds.

The Android Emulator works in a completely different way. An Android Emulator uses an open source application called QEMU (or Quick Emulator) to emulate the entire Android hardware device. It runs code that interprets machine code that’s intended to ...

Get Head First Android Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.