Android Studio Emulator (Android 9.0) with ARM Binaries

A quick guide how to run ARM binaries with Google Play Services on android 9.0 in Android Studio virtual devices

Fahri Shihab
4 min readMay 13, 2020

A lot of penetration testers use an emulator instead of a physical device for testing. This gives the testers easy access to different android API versions, devices, rooted/non-rooted. Many people go for Genymotion’s emulator (which comes rooted by default), while I prefer Android Studio’s emulator.

Usually, a typical testing scenario goes like this:
1. Create a virtual device
2. Install your target APK to the device
3. Set a proxy
4. Start testing

That is an ideal scenario. Life would be so much easier for testers if that is always the case. However, in life, not everything happens as you hope it would 😃. This blog is meant to be my personal write up for future occurrences, but I thought since this is helpful for me it might be helpful for someone else, hopefully you.

Let’s start this process step-by step.

Creating A Virtual Device

Common Problems

The few problems that I run into are:

  1. Most of the apps rely on Google Play Services to run, make sure the system image you are using has Google Play Services.
  2. The production apps are built for ARM binaries, this will give you a INSTALL_FAILED_NO_MATCHING_ABIS error when you try to install it on a x86 system image. Most physical devices won’t run into this problem.

You may have noticed when you’re about to create a virtual device, you are presented with a lot of options.

  • Google APIs Intel x86…
  • Google Play Intel x86…
  • Google X86_ARM Intel x86…

The difference between the first two (Google API & Google Play) is:

  • Google API system images will come with Google Play Services.
  • Google Play system images will come with Google Play Services AND Google Play Store.

With Google Play Store images, you won’t be able to get root on the kernel, which will be a huge deal breaker. Because if we want to install a certificate, starting from android 7.0.0, it has to be installed under system certificates. If you would like to know more, you can visit the official documentation.

Luckily, the Google X86_ARM Intel x86 Atom System Image comes with Google APIs and it has the ability to support ARM binaries. This was released recently in February 29,2020. This option will tackle the 2 common problems that we would most likely run into. Although it does not have Google Play Store, you can still get the target APK from your physical device or somewhere on the internet.

Now you can create a virtual device with the above system image. Great, you have an android 9.0 API 28 virtual device! 😎

Installing Your APK To The Device

This step is pretty straight forward, you can use your terminal and run

adb install application.apk

or you can also drag and drop the application to your terminal.

Verify that you can at least use Google Maps on your virtual device, or you can also check under settings->applications and search for Google Play Services

Setting A Proxy To Intercept Requests

If you are using Burp Suite or any other traffic interceptor, you need to install your certificate on your virtual device to intercept https requests. Unfortunately, the traditional way of installing it as a user certificate does not work anymore. If you visit the link you might have noticed this on the bottom of the page.

We are running Android version 9.0, so the above method won’t work.

I found this blogpost which talks about setting up burp for Android Nougat (Android 7.0) by installing the certificate as a system certificate. This method still works with Android 9.0. Follow the steps from that blogpost and you should be golden 🏆.

Of course this method won’t work if your target application has SSL Pinning or some other detection. You have plenty of other options such as decompiling and recompiling the app or use Frida. But those are for another blog post, it will be way out of topic for this post.

Start Testing

If everything goes smoothly, you should see your traffic on your burp history and you can start testing right away. 🤩🤩🤩

Conclusion

Most people are afraid for a change, they fear that if they upgrade their android version or switch to another emulator, things might not work like before. This happened to me and I spent a couple of days trying to figure this out. Now I can refer back to this blog post if I run into such problems again. Let me know what your thoughts are and what emulator you guys are using, if you’ve had any problems and how to solve them.

Cheers!

--

--