React Native - Environment Setup


There are a couple of things you need to install to set up the environment for React Native. We will use OSX as our building platform.

S.NO. Software Description
1 NodeJS and NPM You can follow our NodeJS Environment Setup tutorial to install NodeJS.

Step 1 - Install Homebrew

Open your terminal and run the following code to install Homebrew −

/usr/bin/ruby -e "$(curl -fsSL"

Step 2 - Install Watchman

Run the following code to install Watchman.

brew install watchman

Step 3 - Install React Native

Now, run the following code to install React Native.

npm install -g react-native-cli

Step 4 Android - Install Android Studio

You can install Android studio by following this link.

Step 4 IOS - Install XCode

For IOS development you will need XCode.

Step 5 - Create First App

We will initialize our first app by running the code given below in the terminal from the folder where we want to create the app (in our case Desktop).

react-native init reactTutorialApp

Step 6 - Run React Native Packager

First, we need to open the app folder in terminal.

cd reactTutorialApp

Now, we can run the packager.

react-native start

You should keep this terminal window running while developing your app.

Step 7 - Run the App on IOS simulator

This step will open your app in the IOS simulator. Run the following command in another terminal.

react-native run-ios