nvm install node && nvm alias default node
, which installs the latest version of Node.js and sets up your terminal so you can run it by typing node
. With nvm you can install multiple versions of Node.js and easily switch between them.npm install -g npm@2
.brew install watchman
. We recommend installing watchman, otherwise you might hit a node file watching bug.brew install flow
, if you want to use flow.We recommend periodically running brew update && brew upgrade
to keep your programs up-to-date.
Xcode 7.0 or higher is required. It can be installed from the App Store.
To write React Native apps for Android, you will need to install the Android SDK (and an Android emulator if you want to work on your app without having to use a physical device). See Android setup guide for instructions on how to set up your Android environment.
NOTE: There is experimental Windows and Linux support for Android development.
To run the iOS app:
$ cd AwesomeProject
ios/AwesomeProject.xcodeproj
and hit run in Xcode.index.ios.js
in your text editor of choice and edit some lines.To run the Android app:
$ cd AwesomeProject
$ react-native run-android
index.android.js
in your text editor of choice and edit some lines.adb logcat *:S ReactNative:V ReactNativeJS:V
in a terminal to see your app's logsNote: If you are using a device, see the Running on Device page.
Congratulations! You've successfully run and modified your first React Native app.
If you run into any issues getting started, see the troubleshooting page.
If you already have a (iOS-only) React Native project and want to add Android support, you need to execute the following commands in your existing project directory:
react-native
dependency in your package.json
file to the latest version$ npm install
$ react-native android