2015-09-14 14:35:58 +00:00
---
id: android-setup
title: Android Setup
layout: docs
category: Quick Start
permalink: docs/android-setup.html
2015-10-21 13:02:27 +00:00
next: linux-windows-support
2015-09-14 14:35:58 +00:00
---
2015-10-17 19:32:16 +00:00
This guide describes basic steps of the Android development environment setup that are required to run React Native android apps on an android emulator. We don't discuss developer tool configuration such as IDEs here.
2015-09-14 14:35:58 +00:00
2015-10-21 13:02:27 +00:00
### Install the Android SDK (unless you have it)
2015-10-17 19:32:16 +00:00
1. [Install the latest JDK ](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html )
2015-10-21 12:31:34 +00:00
2. Install the Android SDK:
2015-10-21 13:02:27 +00:00
- **On Mac**: `brew install android-sdk`
2015-10-21 12:31:34 +00:00
- **On Linux and Windows**: [Download from the Android website ](https://developer.android.com/sdk/installing/index.html )
### Define the ANDROID_HOME environment variable
__IMPORTANT__: Make sure the `ANDROID_HOME` environment variable points to your existing Android SDK:
2015-10-21 13:02:27 +00:00
2015-10-21 12:31:34 +00:00
- **On Mac**, add this to your `~/.bashrc` , `~/.bash_profile` or whatever your shell uses:
2015-10-21 13:02:27 +00:00
2015-10-21 12:31:34 +00:00
# If you installed the SDK via Homebrew, otherwise ~/Library/Android/sdk
2015-09-14 14:35:58 +00:00
export ANDROID_HOME=/usr/local/opt/android-sdk
2015-10-21 12:31:34 +00:00
- **On Linux**, add this to your `~/.bashrc` , `~/.bash_profile` or whatever your shell uses:
export ANDROID_HOME=< path_where_you_unpacked_android_sdk >
- **On Windows**, go to `Control Panel` -> `System and Security` -> `System` -> `Change settings` -> `Advanced` -> `Environment variables` -> `New`
2015-10-17 19:32:16 +00:00
### Configure your SDK
2015-10-21 12:31:34 +00:00
1. Open the Android SDK Manager (**on Mac** start a new shell and run `android` ); in the window that appears make sure you check:
2015-09-14 14:35:58 +00:00
* Android SDK Build-tools version 23.0.1
* Android 6.0 (API 23)
* Android Support Repository
2015-10-17 19:32:16 +00:00
2. Click "Install Packages"
2015-09-14 14:35:58 +00:00
2015-10-17 19:32:16 +00:00
![SDK Manager window ](/react-native/img/AndroidSDK1.png ) ![SDK Manager window ](/react-native/img/AndroidSDK2.png )
2015-09-14 14:35:58 +00:00
2015-10-17 19:32:16 +00:00
### Install Genymotion
2015-10-20 10:35:48 +00:00
Genymotion is much easier to set up than stock Google emulators. However, it's only free for personal use. If you want to use the stock Google emulator, see below.
2015-10-17 19:32:16 +00:00
1. Download and install [Genymotion ](https://www.genymotion.com/ )
2. Open Genymotion
3. Create a new emulator and start it
2015-10-20 10:35:48 +00:00
### Alternative: Create a stock Google emulator
1. Start a new shell and run `android` ; in the window that appears make sure you check:
* Intel x86 Atom System Image (for Android 5.1.1 - API 22)
* Intel x86 Emulator Accelerator (HAXM installer)
2. Click "Install Packages".
3. [Configure hardware acceleration (HAXM) ](http://developer.android.com/tools/devices/emulator.html#vm-mac ), otherwise the emulator is going to be slow.
4. Create an Android Virtual Device (AVD):
1. Run `android avd` and click on **Create...**
![Create AVD dialog ](/react-native/img/CreateAVD.png )
2. With the new AVD selected, click `Start...`