diff --git a/releases/next/docs/getting-started.html b/releases/next/docs/getting-started.html index 14503c42a6c..fb1861e27cb 100644 --- a/releases/next/docs/getting-started.html +++ b/releases/next/docs/getting-started.html @@ -80,31 +80,56 @@ choco install jdk8

If you have already installed Node on your system, ma

Android Studio requires a recent version of the Java SE Development Kit (JDK). Go ahead and install JDK 8 or newer if needed.

-

1. Download and install Android Studio #

Android Studio provides the Android SDK and AVD (emulator) required to run and test your React Native apps. Download Android Studio, then follow the installation instructions. Choose Custom installation when prompted by the Setup Wizard, and proceed to the next step.

+

1. Install Android Studio #

Android Studio provides the Android SDK and Android Virtual Device (emulator) required to run and test your React Native apps. Download and install Android Studio.

Once the installation process is completed, launch Android Studio. Choose "Custom" when prompted to select an installation type. Make sure the boxes next to all of the following are checked:

-

2. Install the AVD and HAXM #

Android Virtual Devices allow you to run Android apps on your computer without the need for an actual Android phone or tablet. Choose Custom installation when running Android Studio for the first time. Make sure the boxes next to all of the following are checked:

Then, click "Next" to install all of these components.

If you've already installed Android Studio before, you can still install HAXM (Windows|Mac) without performing a custom installation.

+

Then, click "Next" to install all of these components.

-

2. Install the AVD and configure VM acceleration #

Android Virtual Devices allow you to run Android apps on your computer without the need for an actual Android phone or tablet. Choose Custom installation when running Android Studio for the first time. Make sure the boxes next to all of the following are checked:

Click "Next" to install all of these components, then configure VM acceleration on your system.

+

Click "Next" to install all of these components, then configure VM acceleration on your system.

-

3. Install the Android 6.0 (Marshmallow) SDK #

Android Studio installs the most recent Android SDK by default. React Native, however, requires the Android 6.0 (Marshmallow) SDK. To install it, launch the SDK Manager, click on "Configure" > "SDK Manager" in the "Welcome to Android Studio" screen.

The SDK Manager can also be found within the Android Studio "Preferences" menu, under Appearance & BehaviorSystem SettingsAndroid SDK.

Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the Android 6.0 (Marshmallow) entry, then make sure the following items are all checked:

Android SDK Manager

Next, select the "SDK Tools" tab and check the box next to "Show Package Details" here as well. Look for and expand the "Android SDK Build Tools" entry, then make sure that Android SDK Build-Tools 23.0.1 is selected.

Finally, click "Apply" to download and install the Android SDK and related build tools.

+

You may also install Intel ® HAXM by following these instructions.

-

4. Set up the ANDROID_HOME environment variable #

The React Native command line interface requires the ANDROID_HOME environment variable to be set up.

+

You may also install Intel ® HAXM by following these instructions.

+ +

2. Install the Android 6.0 (Marshmallow) SDK #

Android Studio installs the most recent Android SDK by default. React Native, however, requires the Android 6.0 (Marshmallow) SDK. You can use the SDK Manager to install additional SDK platforms. To access the SDK Manager, click on "Configure", then select "SDK Manager" from the "Welcome to Android Studio" screen.

The SDK Manager can also be found within the Android Studio "Preferences" dialog, under Appearance & BehaviorSystem SettingsAndroid SDK.

Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the Android 6.0 (Marshmallow) entry, then make sure the following items are all checked:

+ +

Android SDK Manager

+ +

Android SDK Manager

+ +

Next, select the "SDK Tools" tab and check the box next to "Show Package Details" here as well. Look for and expand the "Android SDK Build-Tools" entry, then make sure that 23.0.1 is selected.

+ +

Android SDK Manager - 23.0.1 Build Tools

+ +

Android SDK Manager - 23.0.1 Build Tools

+ +

Finally, click "Apply" to download and install the Android SDK and related build tools.

+ +

Android SDK Manager - Installs

+ +

Android SDK Manager - Installs

+ +

3. Set up the ANDROID_HOME environment variable #

The React Native command line interface requires the ANDROID_HOME environment variable to be set up.

Add the following lines to your ~/.profile (or equivalent) config file:

export ANDROID_HOME=${HOME}/Library/Android/sdk export PATH=${PATH}:${ANDROID_HOME}/tools -export PATH=${PATH}:${ANDROID_HOME}/platform-tools

Type source ~/.profile to load the config into your current shell.

Please make sure you export the correct path for ANDROID_HOME. If you installed the Android SDK using Homebrew, it would be located at /usr/local/opt/android-sdk.

+export PATH=${PATH}:${ANDROID_HOME}/platform-tools

Type source ~/.profile to load the config into your current shell.

Please make sure you export the correct path for ANDROID_HOME. If you installed the Android SDK using Homebrew, it would be located at /usr/local/opt/android-sdk. You can find the actual location of the SDK in the Android Studio "Preferences" dialog, under Appearance & BehaviorSystem SettingsAndroid SDK.

Add the following lines to your ~/.profile (or equivalent) config file:

export ANDROID_HOME=${HOME}/Android/Sdk export PATH=${PATH}:${ANDROID_HOME}/tools -export PATH=${PATH}:${ANDROID_HOME}/platform-tools

Type source ~/.profile to load the config into your current shell.

Please make sure you export the correct path for ANDROID_HOME if you did not install the Android SDK using Android Studio.

+export PATH=${PATH}:${ANDROID_HOME}/platform-tools

Type source ~/.profile to load the config into your current shell.

Please make sure you export the correct path for ANDROID_HOME if you did not install the Android SDK using Android Studio. You can find the actual location of the SDK in the Android Studio "Preferences" dialog, under Appearance & BehaviorSystem SettingsAndroid SDK.

-

Go to Control PanelSystem and SecuritySystemChange settings → -Advanced System SettingsEnvironment variablesNew, then enter the path to your Android SDK.

env variable

Restart the Command Prompt to apply the new environment variable.

Please make sure you export the correct path for ANDROID_HOME if you did not install the Android SDK using Android Studio.

+

Open the System pane under System and Security in the Control Panel, then click on Change settings.... Open the Advanced tab and click on Environment Variables.... Click on New... to create a new ANDROID_HOME user variable that points to the path to your Android SDK.

ANDROID_HOME Environment Variable

You can find the actual location of the SDK in the Android Studio "Preferences" dialog, under Appearance & BehaviorSystem SettingsAndroid SDK.

Open a new Command Prompt window to ensure the new environment variable is loaded.

Watchman (optional) #

Follow the Watchman installation guide to compile and install Watchman from source.

Watchman is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance, but it's alright to skip this if you find the process to be tedious.

-

Starting the Android Virtual Device #

Android Studio AVD Manager

You can see the list of available AVDs by opening the "AVD Manager" from within Android Studio.

Once in the "AVD Manager", select your AVD and click "Edit...". Choose "Android 6.0 - API Level 23" under Device, and "Intel Atom (x86_64)" under CPU/ABI. Click OK, then select your new AVD and click "Start...", and finally, "Launch".

Android AVD Configuration

It is very common to run into an issue where Android Studio fails to create a default AVD. You may follow the Android Studio User Guide to create a new AVD manually if needed.

Using a real device #

If you have a physical Android device, you can use it for development in place of an AVD. Plug it in to your computer using a USB cable and enable USB debugging before proceeding to the next step.

+

Starting the Android Virtual Device #

You can see the list of available AVDs by opening the "AVD Manager" from within Android Studio:

Android Studio AVD Manager

+ +

Launch the default AVD before proceeding to the next step.

+ +

Once in the "AVD Manager", select your AVD and click "Edit...". Choose "Android 6.0 - API Level 23" under Device, and "Intel Atom (x86_64)" under CPU/ABI. Click OK, then select your new AVD and click "Start...", and finally, "Launch".

Android AVD Configuration

+ +

It is very common to run into an issue where Android Studio fails to create a default AVD. You may follow the Android Studio User Guide to create a new AVD manually if needed.

Using a real device #

If you have a physical Android device, you can use it for development in place of an AVD. Plug it in to your computer using a USB cable and enable USB debugging before proceeding to the next step.

Testing your React Native Installation #

@@ -116,7 +141,7 @@ react-native run

Use the React Native command line interface to generate a new React Native project called "AwesomeProject", then run react-native run-android inside the newly created folder:

# skip this first command if you ejected from Create React Native App react-native init AwesomeProject cd AwesomeProject -react-native run-android

If everything is set up correctly, you should see your new app running in your Android emulator shortly.

AwesomeProject on Android

react-native run-android is just one way to run your app - you can also run it directly from within Android Studio or Nuclide.

+react-native run-android

If everything is set up correctly, you should see your new app running in your Android emulator shortly.

AwesomeProject on Android

react-native run-android is just one way to run your app - you can also run it directly from within Android Studio or Nuclide.

Modifying your app #

Now that you have successfully run the app, let's modify it.

@@ -138,7 +163,7 @@ react-native init AwesomeProject cd AwesomeProject react-native run-android -

If everything is set up correctly, you should see your new app running in your Android emulator shortly.

AwesomeProject on Android

+

If everything is set up correctly, you should see your new app running in your Android emulator shortly.

AwesomeProject on Android

Modifying your app #

Now that you have successfully run the app, let's modify it.

  • Open index.android.js in your text editor of choice and edit some lines.
  • Press the R key twice or select Reload from the Developer Menu to see your change!

That's it! #

Congratulations! You've successfully run and modified a React Native app.

diff --git a/releases/next/img/AndroidEnvironmentVariableANDROID_HOME.png b/releases/next/img/AndroidEnvironmentVariableANDROID_HOME.png new file mode 100644 index 00000000000..1e6d35caa6a Binary files /dev/null and b/releases/next/img/AndroidEnvironmentVariableANDROID_HOME.png differ diff --git a/releases/next/img/AndroidSDKManagerInstallsMacOS.png b/releases/next/img/AndroidSDKManagerInstallsMacOS.png new file mode 100644 index 00000000000..1d997852ea8 Binary files /dev/null and b/releases/next/img/AndroidSDKManagerInstallsMacOS.png differ diff --git a/releases/next/img/AndroidSDKManagerInstallsWindows.png b/releases/next/img/AndroidSDKManagerInstallsWindows.png new file mode 100644 index 00000000000..e0e4deb7f99 Binary files /dev/null and b/releases/next/img/AndroidSDKManagerInstallsWindows.png differ diff --git a/releases/next/img/AndroidSDKManager.png b/releases/next/img/AndroidSDKManagerMacOS.png similarity index 100% rename from releases/next/img/AndroidSDKManager.png rename to releases/next/img/AndroidSDKManagerMacOS.png diff --git a/releases/next/img/AndroidSDKManagerSDKToolsMacOS.png b/releases/next/img/AndroidSDKManagerSDKToolsMacOS.png new file mode 100644 index 00000000000..81fca097721 Binary files /dev/null and b/releases/next/img/AndroidSDKManagerSDKToolsMacOS.png differ diff --git a/releases/next/img/AndroidSDKManagerSDKToolsWindows.png b/releases/next/img/AndroidSDKManagerSDKToolsWindows.png new file mode 100644 index 00000000000..5ea04a60483 Binary files /dev/null and b/releases/next/img/AndroidSDKManagerSDKToolsWindows.png differ diff --git a/releases/next/img/AndroidSDKManagerWindows.png b/releases/next/img/AndroidSDKManagerWindows.png new file mode 100644 index 00000000000..fe78e2a2f45 Binary files /dev/null and b/releases/next/img/AndroidSDKManagerWindows.png differ diff --git a/releases/next/img/AndroidSuccess.png b/releases/next/img/AndroidSuccessMacOS.png similarity index 100% rename from releases/next/img/AndroidSuccess.png rename to releases/next/img/AndroidSuccessMacOS.png diff --git a/releases/next/img/AndroidSuccessWindows.png b/releases/next/img/AndroidSuccessWindows.png new file mode 100644 index 00000000000..4c653bae64f Binary files /dev/null and b/releases/next/img/AndroidSuccessWindows.png differ diff --git a/releases/next/img/react-native-android-sdk-environment-variable-windows.png b/releases/next/img/react-native-android-sdk-environment-variable-windows.png deleted file mode 100644 index 6b3d9810a53..00000000000 Binary files a/releases/next/img/react-native-android-sdk-environment-variable-windows.png and /dev/null differ