A while ago I described how to get Android Jelly Bean fully emulated on a Mac.
Recently I wanted to try out the latest Android release – 5.0 Lollipop – but the instructions no longer work, perhaps because of a bug or incompatibility in Genymotion, which is used for the emulation. Notably, the usual drag and drop method of flashing files doesn’t work.
After a bit of hacking and researching, I found a way to get it all working, just about – that’s the full Android Lollypop, complete with the proprietary Google Play services such as the Google Play Store. You can run apps and play most games. It’s pretty cool.
The instructions below assume you’ve not got any of the required software installed (which is all either free for personal use, or open source). You can skip some of the steps if you have.
- Download and install VirtualBox.
- Visit the Genymotion site, register with them, and download their Android virtualizer for Mac OS X.
- Start Genymotion and then click the plus “Add” button. Choose to download and install any of the Lollypop images (you can use the “Android Version” filter at the top) – but don’t start it yet once it’s installed!
- Click the spanner icon alongside the new entry in the list and configure the screen resolution for something sensible, and perhaps drop the number of processors and/or increase the RAM. I find 1 CPU core, 2-3GB of memory and a resolution of 1280×800 for a tablet works fine. Choose a DPI of 160.
- Download and install the Android SDK. This is a huge app of which we only need a tiny component called adb. You might find sites that’ve packaged just adb for download and installation, but I can’t vouch for the safety of the files. Install the Android SDK but beware it’ll take a while. Don’t skip to the next step until it’s finished.
- In Genymotion, click the cog icon to access Settings, then select the ADB tab, and select to “Use Custom Android SDK Tools”. Hopefully the path should fill in automatically beneath, but it’ll be something like /Users/USERNAME/Library/Android/sdk, with your username in place of USERNAME (duh!).
- Open a Terminal window (it’s in the Utilities folder of the Applications list).
- Using Genymotion, start the emulated Android tablet/phone so it boots to the home screen. On the first boot this might take some time.
- Look at the top right of the emulated Android titlebar. You’ll see the IP address – something like 192.168.56.101. Make a note of this. You may have to horizontally expand the Genymotion window if emulating a phone to make it wide enough for the IP address to appear.
- In the Terminal window, type
… hit Enter, and then type the following (but don’t yet hit Enter)
… then type the IP address and hit Enter. On my system I typed the following:
adb connect 192.168.56.101
- Download the following two files to your Downloads folder: Genymotion-ARM-Translation_v1.1.zip and gapps-lp-20141109-signed.zip
- Back in the Terminal window, type the following commands in sequence, waiting for each to finish before typing the next:
adb push Genymotion-ARM-Translation_v1.1.zip /sdcard/Download/ adb push gapps-lp-20141109-signed.zip /sdcard/Download/ adb shell "/system/bin/flash-archive.sh /sdcard/Download/Genymotion-ARM-Translation_v1.1.zip" adb shell "/system/bin/flash-archive.sh /sdcard/Download/gapps-lp-20141109-signed.zip" adb reboot
And once the emulator has rebooted to the home screen, type:
You’ll likely encounter errors in the emulated Android, such as apps crashing and not installed properly, but these can be fixed with a little playing around. The most important task is to update everything in the emulated Android ASAP using Google Play etc.