From e1528a193d963cf7ca41acec0866ee0281672dfb Mon Sep 17 00:00:00 2001
From: Website Deployment Script You will need Node.js, Watchman, the React Native command line interface, and Xcode. You will need Node.js, Watchman, the React Native command line interface, and Android Studio. You will need Node.js, Watchman, the React Native command line interface, and Xcode. You will need Node.js, Watchman, the React Native command line interface, and Android Studio. You will need Node.js, the React Native command line interface, and Android Studio. We recommend installing Node and Watchman using Homebrew. Run the following commands in a Terminal after installing Homebrew: Watchman is a tool by Facebook for watching
-changes in the filesystem. It is highly recommended you install it for better performance. Node.js comes with npm, which lets you install the React Native command line interface. Run the following command in a Terminal: If you get a permission error, try using sudo: If you get an error like Unsupported #

Installing Dependencies #
Installing Dependencies #
Installing Dependencies #
Installing Dependencies #
Node, Watchman #
The React Native CLI #
sudo npm install -g react-native-cli.Cannot find module 'npmlog', try installing npm directly: curl -0 -L http://npmjs.org/install.sh | sudo sh.
The easiest way to install Xcode is via the Mac App Store. Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.
Follow the installation instructions for your Linux distribution to install Node.js 4 or newer.
Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps.
Download and install Android Studio.
Android Studio installs Android 7.0 (Nougat) by default. You can confirm that the SDK was installed by clicking on "Configure" in the last screen in the Android Studio Setup Wizard, or by opening "Preferences" from the Android Studio menu, then choosing Appearance and Behavior → System Settings → Android SDK.

Select "SDK Platforms" from within the SDK Manager and you should see a blue checkmark next to "Android 7.0 (Nougat)". In case it is not, click on the checkbox and then "Apply".

If you wish to support older versions of Android, you can install additional Android SDKs from this screen.
The React Native command line interface requires the ANDROID_HOME environment variable to be set up. You can configure it in a Terminal using the following command:
To avoid doing this every time you open a new terminal, add the following lines to your ~/.bashrc or equivalent config file:
The second line will add the android tool to your path, which will come in handy in the next step.
Please make sure you export the correct path for
ANDROID_HOMEif you did not install the Android SDK using Android Studio. If you install the Android SDK using Homebrew, it will be located at/usr/local/opt/android-sdk.
Android Studio should have set up an Android Virtual Device for you during installation, but it is very common to run into an issue where Android Studio fails to install the AVD.

To see the list of available AVDs, launch the "AVD Manager" from within Android Studio or run the following command in a Terminal:
You may follow the Android Studio User Guide to create a new AVD if needed.
+If you see "No system images installed for this target." under CPU/ABI, go back to your "SDK Manager" and click on "Show Package Details" under "SDK Platforms". You will then be able to install any missing system images, such as "Google APIs Intel Atom (x86)".
We recommend installing Node.js and Python2 via Chocolatey, a popular package manager for Windows. Open a Command Prompt as Administrator, then run:
You can find additional installation options on Node.js's Downloads page.
Node.js comes with npm, which lets you install the React Native command line interface.
Node.js comes with npm, which lets you install the React Native command line interface.
You will need Node.js, the React Native command line interface, and Android Studio.
Follow the installation instructions for your Linux distribution to install Node.js 4 or newer.
Run the following command in a Terminal:
If you get a permission error, try using sudo:
sudo npm install -g react-native-cli.If you get an error like
Cannot find module 'npmlog', try installing npm directly:curl -0 -L http://npmjs.org/install.sh | sudo sh.
You will need Node.js, the React Native command line interface, and Android Studio.
We recommend installing Node.js and Python2 via Chocolatey, a popular package manager for Windows. Open a Command Prompt as Administrator, then run:
You can find additional installation options on Node.js's Downloads page.
The easiest way to install Xcode is via the Mac App Store. Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.
Node comes with npm, which lets you install the React Native command line interface.
Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps.
Download and install Android Studio.
Android Studio installs Android 7.0 (Nougat) by default. You can confirm that the SDK was installed by clicking on "Configure" in the last screen in the Android Studio Setup Wizard, or by opening "Preferences" from the Android Studio menu, then choosing Appearance and Behavior → System Settings → Android SDK.

Select "SDK Platforms" from within the SDK Manager and you should see a blue checkmark next to "Android 7.0 (Nougat)". In case it is not, click on the checkbox and then "Apply".

If you wish to support older versions of Android, you can install additional Android SDKs from this screen.
The React Native command line interface requires the ANDROID_HOME environment variable to be set up.
Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps.
Android Studio provides the Android SDK and AVD (emulator) required to run and test your React Native apps.
Create or edit your ~/.bashrc file and add the following lines:
Android Studio requires the Java Development Kit (JDK), version 1.8 or higher. You can type
javac -versionin a terminal to see what version you have, if any.
Choose Custom installation when running Android Studio for the first time. Make sure the boxes next to all of the following are checked:
Android SDKAndroid SDK PlatformPerformance (Intel ® HAXM)Android Virtual DeviceThen, click "Next" to install all of these components.
If you've already installed Android Studio before, you can still install HAXM without performing a custom installation.
Choose Custom installation when running Android Studio for the first time. Make sure the boxes next to all of the following are checked:
Android SDKAndroid SDK PlatformAndroid Virtual DeviceClick "Next" to install all of these components, then configure VM acceleration on your system.
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" in the "Welcome to Android Studio" screen.
The SDK Manager can also be found within the Android Studio "Preferences" menu, under Appearance & Behavior → System Settings → Android SDK.
Select "SDK Platforms" from within the SDK Manager, then check the box next to "Show Package Details". Look for and expand the Android 6.0 (Marshmallow) entry, then make sure the following items are all checked:
Google APIsIntel x86 Atom System ImageIntel x86 Atom_64 System ImageGoogle APIs Intel x86 Atom_64 System ImageNext, select "SDK Tools" 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.
The React Native command line interface requires the ANDROID_HOME environment variable to be set up.
Add the following lines to your ~/.bashrc (or equivalent) config file:
The second line will add the android tool to your path, which will come in handy in the next step. The third line will add the adb tool to your path, which is used to communicate with your Android device / emulator.
Please make sure you export the correct path for
ANDROID_HOMEif you did not install the Android SDK using Android Studio.
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.
Go to Control Panel → System and Security → System → Change settings →
-Advanced System Settings → Environment variables → New, then enter the path to your Android SDK.

Please make sure you use the correct path for
ANDROID_HOMEif you did not install the Android SDK using Android Studio.
Restart the Command Prompt to apply the new environment variable.
Add the following lines to your ~/.bashrc (or equivalent) config file:
Please make sure you export the correct path for
ANDROID_HOMEif you did not install the Android SDK using Android Studio.
Android Studio should have set up an Android Virtual Device for you during installation, but it is very common to run into an issue where Android Studio fails to install the AVD.

To see the list of available AVDs, launch the "AVD Manager" from within Android Studio or run the following command in a terminal:
You may follow the Android Studio User Guide to create a new AVD if needed.
If you see "No system images installed for this target." under CPU/ABI, go back to your "SDK Manager" and click on "Show Package Details" under "SDK Platforms". You will then be able to install any missing system images, such as "Google APIs Intel Atom (x86)".
Go to Control Panel → System and Security → System → Change settings → +Advanced System Settings → Environment variables → New, then enter the path to your Android SDK.

Restart the Command Prompt to apply the new environment variable.
Please make sure you export the correct path for
ANDROID_HOMEif you did not install the Android SDK using Android Studio.
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.

You can see the list of available AVDs by opening the "AVD Manager" from within Android Studio. You can also run the following command in a terminal:
Once in the "AVD Manager", select your AVD and click "Start...".
Android Studio should have set up an Android Virtual Device for you during installation, but it is very common to run into an issue where Android Studio fails to install the AVD. You may follow the Android Studio User Guide to create a new AVD manually if needed.
Use the React Native command line interface to generate a new React Native project called "AwesomeProject", then run react-native run-ios inside the newly created folder.
You should see your new app running in the iOS Simulator shortly.
react-native run-ios is just one way to run your app. You can also run it directly from within Xcode or Nuclide.
You should see your new app running in the iOS Simulator shortly.
react-native run-ios is just one way to run your app. You can also run it directly from within Xcode or Nuclide.
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.
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:
If everything is set up correctly, you should see your new app running in your Android emulator shortly. react-native run-android is just one way to run your app - you can also run it directly from within Android Studio or Nuclide.
If everything is set up correctly, you should see your new app running in your AVD shortly.
react-native run-android is just one way to run your app - you can also run it directly from within Android Studio or Nuclide.
Now that you have successfully run the app, let's modify it.
Now that you have successfully run the app, let's modify it.
index.android.js in your text editor of choice and edit some lines.R key twice or select Reload from the Developer Menu to see your change!Congratulations! You've successfully run and modified a React Native app.

If you want to add this new React Native code to an existing application, check out the Integration guide.
If you can't get this to work, see the Troubleshooting page.
If you're curious to learn more about React Native, continue on +to the Tutorial.
If you want to add this new React Native code to an existing application, check out the Integration guide.
If you can't get this to work, see the Troubleshooting page.
If you're curious to learn more about React Native, continue on to the Tutorial.