Image for post
Image for post
React Native and Google’s Android Emulator — The better solution.

How to Install, Setup and Use Android Emulator for Mac, Linux and Windows without installing Android Studio

— And save yourself a lot of space!

Image for post
Image for post
Image for post
Image for post
Scene credits: Peaky Blinders. Image editing credits: Rishi Kumar

Step 1: Install Java Development Kit 8.

brew tap caskroom/versions
brew cask install java8

Step 2: Install Android SDK.

brew cask install android-sdk
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema 
at (
touch ~/.android/repositories.cfg
export ANDROID_HOME=/path/to/android-sdk

Important note for the next two steps:

Step 3: Install platform and build tools required for React Native.

sdkmanager "platforms;android-23" "build-tools;23.0.1" "add-ons;addon-google_apis-google-23"
sdkmanager --list
sdkmanager "sdk-path-for-package"
sdkmanager "system-images;android-23;google_apis;x86"
sdkmanager "emulator"

Step 4: Create a new virtual device.

sdkmanager "system-images;android-23;google_apis;x86"
avdmanager create avd --force --name myTestDevice --abi google_apis/x86 --package 'system-images;android-23;google_apis;x86' --device "myTestDevice"
emulator -list-avds
emulator -avd myTestDevice

Written by

Code. All day long.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store