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
Dammit!
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 com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.SdkManagerCli.main (SdkManagerCli.java:117)
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