Setup for Mac

Installing package manager Homebrew brew

Paste that at a Terminal prompt.

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

Installing Xcode IDE

Download it using link below or find it on Mac App Store

NOTE:

If you have Xcode-beta.app installed along with production version of Xcode.app, make sure you are using production version of xcodebuild tool. You can set it with:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

Installing Android environment

Git

*If you have installed XCode, Git is already installed, otherwise run the following

brew install git

Latest JDk

Android studio

Choose a Custom installation

Choose custom and then next


After installation, choose Configure -> SDK Manager from the Android Studio welcome window.

In the SDK Platforms window, choose Show Package Details and under Android 6.0 (Marshmallow), make sure that Google APIs, Intel x86 Atom System Image, Intel x86 Atom_64 System Image, and Google APIs Intelx86 Atom_64 System Image are checked.

In the SDK Tools window, choose Show Package Details and under Android SDK Build Tools, make sure that Android SDK Build-Tools 23.0.1 is selected.

Environment Variable ANDROID_HOME

Ensure the ANDROID_HOME environment variable points to your existing Android SDK. To do that, add this to your ~/.bashrc, ~/.bash_profile (or whatever your shell uses) and re-open your terminal:If you installed the SDK without Android Studio, then it may be something like: /usr/local/opt/android-sdk

export ANDROID_HOME=~/Library/Android/sdk

Dependencies for Mac

You will need Xcode for iOS and Android Studio for android, node.js, the React Native command line tools, and Watchman.We recommend installing node and watchman via Homebrew.

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.

For iOS the easiest way to install Xcode is via the Mac App Store. And for android download and install Android Studio.If you plan to make changes in Java code, we recommend Gradle Daemon 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.

Modifying your app

Now that you have successfully run the app, let’s modify it.Open index.ios.js or index.android.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! That’s it!

If you like this post, don’t forget to share ūüôā

This article is written by our awesome writer
Comments to: Environment Setup In React Native

Your email address will not be published. Required fields are marked *

Attach images - Only PNG, JPG, JPEG and GIF are supported.

New Dark Mode Is Here

Sign In to access the new Dark Mode reading option.

Join our Newsletter

Get our monthly recap with the latest news, articles and resources.

By subscribing you agree to our Privacy Policy.

Latest Articles

Explore Tutorials By Categories

About

Codeverb is simply an all in one interactive learning portal, we regularly add new topics and keep improving the existing ones, if you have any suggestions, questions, bugs issue or any other queries you can simply reach us via the contact page

Login

Welcome to Codeverb

Ready to learn something new?
Join Codeverb!

Read Smart, Save Time
  •  
    Strength indicator
  •  
  •  
    Log In | Lost Password