--- id: quick-start-getting-started title: Getting Started layout: docs category: The Basics permalink: docs/getting-started.html next: basics-components ---
Target: iOS Android Development OS: Mac Linux Windows
## Unsupported
Unfortunately, Apple only lets you develop for iOS on a Mac. If you want to build an iOS app but you don't have a Mac yet, you can try starting with the Android instructions instead.
## Dependencies You will need Xcode, node.js, the React Native command line tools, and Watchman. ## Dependencies You will need Android Studio, node.js, the React Native command line tools, and Watchman. We recommend installing node and watchman via [Homebrew](http://brew.sh/). ``` brew install node brew install watchman ``` Node comes with npm, which lets you install the React Native command line interface. ``` npm install -g react-native-cli ``` If you get a permission error, try with sudo: `sudo npm install -g react-native-cli`. The easiest way to install Xcode is via the [Mac App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12). Download and install [Android Studio](https://developer.android.com/studio/install.html). If you plan to make changes in Java code, we recommend [Gradle Daemon](https://docs.gradle.org/2.9/userguide/gradle_daemon.html) which speeds up the build. ## Dependencies You will need node.js, the React Native command line tools, Watchman, and Android Studio. Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node.js 4 or newer. We recommend installing node.js and Python2 via [Chocolatey](https://chocolatey.org), a popular package manager for Windows. Open a Command Prompt as Administrator, then run: ``` choco install nodejs.install choco install python2 ``` Node comes with npm, which lets you install the React Native command line interface. ``` npm install -g react-native-cli ``` Download and install [Android Studio](https://developer.android.com/studio/install.html). [Watchman](https://facebook.github.io/watchman) is a tool by Facebook for watching changes in the filesystem. Installing it should improve performance, but you can also try not installing it, if the installation process is too annoying. You can follow the [Watchman installation guide](https://facebook.github.io/watchman/docs/install.html#installing-from-source) to compile and install from source. If you plan to make changes in Java code, we recommend [Gradle Daemon](https://docs.gradle.org/2.9/userguide/gradle_daemon.html) which speeds up the build. ## Testing your React Native Installation Use the React Native command line tools to generate a new React Native project called "AwesomeProject", then run `react-native run-ios` inside the newly created folder. ``` react-native init AwesomeProject cd AwesomeProject react-native run-ios ``` 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 tools to generate a new React Native project called "AwesomeProject", then run `react-native run-android` inside the newly created folder. ``` 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. `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. - Open `index.ios.js` in your text editor of choice and edit some lines. - Hit `Command⌘ + R` in your iOS Simulator to reload the app and see your change! - 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 your first React Native app.
## Testing your React Native Installation Use the React Native command line tools to generate a new React Native project called "AwesomeProject", then run `react-native run-android` inside the newly created folder. ``` 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. > A common issue is that the packager is not started automatically when you run `react-native run-android`. You can start it manually using `react-native start`. > If you hit a `ERROR Watcher took too long to load` on Windows, try increasing the timeout in [this file](https://github.com/facebook/react-native/blob/5fa33f3d07f8595a188f6fe04d6168a6ede1e721/packager/react-packager/src/DependencyResolver/FileWatcher/index.js#L16) (under your `node_modules/react-native/`). ### 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.
## Special Cases - This page explains how to create a new React Native app. If you are adding React Native components to an existing application, check out the [Integration guide](docs/integration-with-existing-apps.html). - If you run into any issues getting started, see the [Troubleshooting](docs/troubleshooting.html#content) page.