Quick Steps :

  1. Install Expo on the desktop as well as device
  2. brew update (if u already have installed brew) OR 
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. brew install node OR  brew upgrade node (if u already installed)
  4. brew install watchman
  5. npm install -g react-native-cli
  6. react-native init [name ur app] –version 0.24.0(depends on which version u want to use, if it didn’t work use below) (6). react-native init [name ur app] –verbose
  7. cd [name ur app]
  8. [name ur app] react-native run-ios OR (open in xcode) go to project folder -> iOS folder -> open .xcodeproj -> open in xcode and click run button(cmd + R)
  9. atom. (open code in any IDE)

 

Step 1 : Node.js

Now for the installation. React native uses Node.js to build the JavaScript code. If you already have it installed on your computer, you can skip the next few steps, otherwise, proceed.

We’ll install Node.js using Homebrew This isn’t the only way to install Node but I find that Homebrew is great as a package manager. With it you can easily install the latest as well as specific versions of a package, have different versions of a package, select which version to use, update and uninstall packages, e.t.c. To install Homebrew, go to their website and follwow the instruction at the top of the page.

Follow following command to install Homebrew

  1.  If you have already Homebrew installed
$ brew update

OR 1. If you don’t have Homebrew installed, To install Homebrew run following command in terminal (this link may change so better copy from their website)

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After Homebrew is installed, install Node.js by pasting the following in a Terminal window.

$ brew install node

To get started with Expo you don’t necessarily need to have Node.js installed, but as soon as you start actually building something you’ll want to have it. you can also Download the latest version of Node.js.

Step 2 : Watchman

Only for mac users

Some macOS users encounter issues if they do not have this installed on their machine, so we recommend that you install Watchman. Watchman watches files and records when they change, then triggers actions in response to this, and it’s used internally by React Native. Download and install Watchman.

Follow following command to install watchman

 1. To install watchman
$ brew install watchman

OR 1. To install the latest build from github:

$ brew install --HEAD watchman

We have completed with all the required setup to run our first app.

Step 3 : 

  • npm install -g react-native-cli
  • react-native init [name ur app]
  • cd [name ur app]
  • [name ur app] react-native run-ios OR (open in xcode) go to project folder -> iOS folder -> open .xcodeproj -> open in xcode and click run button(cmd + R)
  • open code in atom. (open code in any IDE)
Advertisements