Emulating Google Play Services on old Android emulators

At Yext, pretty much everything that I do is related to location. After all, we help people go places, and to do that I need to know where those places are. Unsurprisingly, my need for location data extends to Android development.

Whether I’m trying to display store locations on a map or find the user’s current location, I need to test our app to make sure that it’s as bug-free as possible. As a growing company with a large user base, I don’t have the luxury of building an app that only supports the most recent versions of Android. As of writing, less than half of Android users are using Lollipop, making it imperative that our app be backwards compatible. Unfortunately, my lobbying has done little to convince Yext of the need to invest in a bank of ~10k devices that I can use to test our apps, so I’m often relegated to the Android emulator in Android Studio to test my latest iteration on our app.

However, in the process, I’ve found that it is not always easy to test an Android app on the emulator when it comes to Google Play Services. Since the app contains a Google MapView, it requires that Play Services be installed for that part of the app to function. It is easy to get this set up for newer versions of Android on the emulator, but for Android versions 4.4 and earlier, it isn’t so trivial because of a bug in the AVD manager. I wrote this article to detail a workaround.

The Problem

Basic setup for the Android emulator is really simple when you want to use Google Play Services. All you have to do is download a system image that includes Google APIs and it automagically works.

System Images

Here is what the emulator looks like with and without Google APIs:

Emulator No Play Services Emulator Play Services

Note: To replicate the app used in these examples, follow the steps here.

This is exactly what is supposed to happen. Since Google APIs are proprietary, they aren’t distributed with the open source system image, but Google provides a system image with them bundled in for this exact purpose.

So far everything is working as expected, but let’s say that we want to test our app on an older OS. We can do the same thing that we did before. In this case, I’ll download Android API level 18 with Play Services.

System Images

But now that I’ve downloaded it, it is nowhere to be seen.

System Images System Images

That’s a problem. The only evidence that anything was downloaded at all comes when we look at the SDK manager and we can see that Google APIs is installed for Android 4.3.1.

SDK Manager

This doesn’t really help us very much, though, since we still can’t see it show up in the AVD Manager.

The Solution

While there is no perfect solution for this, I have spent a long time coming up with a decent workaround to this problem. This solution will work for any emulator running Android levels 15 - 19 and should be unnecessary for level 21+ (there is no Google APIs image for level 20, so we’re kinda stuck there).

First, we need to download the Play Services package for the Android level that we want our emulator to run. I’ll demonstrate with Android level 19, but you can substitute in whatever level you like.

To do this, go to Tools > Android > SDK Manager and check Show Package Details. Then install Google APIs. For API level 19 you can choose between x86 and ARM (go with x86), but for earlier versions, you only have one option, which is ARM (although it doesn’t specify that).

SDK Manager

After you’ve done installing Google APIs, confirm the location of the install on your machine. By default, the location should be ~/Library/Android/sdk/add-ons. If it is somewhere different, you can substitute that into the following instructions.

Next, create a new emulator. I’ve had mixed success with emulating older Android levels on newer devices, so I recommend choosing an older device, such as a Nexus One for your emulator.

For the system image, download the system image that corresponds to the API level of the Google APIs that you downloaded. Note that unless you specifically selected an x86 version of Google APIs, you should use the armeabi-v7a system image, not x86. It is also important that you download the system image that does NOT include Google APIs to avoid the problem discussed above.

System Images

Go ahead and finish setting up your emulator. Once it is setup, right click on the emulator in the AVD manager and click “Show on Disk”. Open the config.ini file and make the following changes:

  1. Change image.sysdir.1 to image.sysdir.2
  2. Add image.sysdir.1=add-ons/addon-google_apis_x86-google-19/images/x86/
  3. Be sure to edit paths to match your system and API level

Config file

Finally, boot up your sparkly brand new emulator and take it for a test drive.

Emulator Play Services


Unfortunately there is still one thing that I have not figured out how to do, and that is to update the version of Google Play Services. This can cause problems if you’re trying to test an app that uses Play Services v7.+ because you will be unable to test them on any emulators prior to API level 21.

The best way to tell what the highest Google Play Services version that is supported is is by looking at the Revision number in the SDK Manager. This can give you a sense, but unfortunately it is not easy to directly map revision number to version number. You will probably be best off testing it for yourself.


In the end, our solution was to get a couple of old phones to test on. The emulator is not really the best way to test regardless, so this was an obvious solution for us. If, however, you’re bootstrapping your project and don’t have the resources, hopefully this can provide a workable solution.