Saturday, April 29, 2017

Step By Step Guide to Install React Native and Create Mobile App in OSX

Hello,

Recently in projects we decided to use React Native to create cross platform mobile application. I faced some difficulties in installing ReactNative so here in this blog I will explain getting started with React Native and create cross platform mobile application.

1) Install Xcode and Xcode command lines tools.



Get Xcode from Mac App Store. Click Here

2) Install Xcode Command Line Tools, Open terminal and run following command.

xcode-select --install

3) Install Homebrew, Homebrew is a package manager to install missing package on OSX. Open terminal and run following command.

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

4) Install NodeJs and NPM. React comes package in NPM so we have to install it. Run following command in terminal

brew install node

After installation check with following command to see if it's installed.

node -v

npm -v

5) Install watchman with home brew.

brew install watchman

6) Install The React Native CLI

Node.js comes with npm, which lets you install the React Native command line interface.

Run the following command in a Terminal

npm install -g react-native-cli

7) Create React Native Project, run following commands in terminal.

react-native init ReactNativeTest

cd ReactNativeTest

Now run it with following command.

react-native run-ios

It will run application in iOS simulator.


react-native run-ios is just one way to run your app. You can also run it directly from within Xcode.



No comments:

Post a Comment