Welcome to %s forums

<No. 1 Community for developers, by developers/>

Login Register

How to Configure your mac machine for React Native development?

React Native related topics are here
Post Reply
admin
Site Admin
Posts: 45

How to Configure your mac machine for React Native development?

Post by admin » Sat Oct 19, 2019 10:57 pm

Setup for Mac
Installing package manager Homebrew brew
Paste that at a Terminal prompt.

Code: Select all

/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
https://developer.apple.com/download/

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:

Code: Select all

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

Code: Select all

brew install git
Latest JDK - http://www.oracle.com/technetwork/java/ ... 33151.html

Android Studio - http://developer.android.com/sdk/index.html
Choose a Custom installation
Image
Choose both Performance and Android Virtual Device
Image
After installation, choose Configure -> SDK Manager from the Android Studio welcome window.
Image
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 Intel x86 Atom_64 System Image are checked.
Image
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.
Image
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.

Code: Select all

brew install node
brew install watchman
Watchman is a tool by Facebook for watching changes in the filesystem. It is highly recommended you
install it for better performance. It is optional.

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

Code: Select all

npm install -g react-native-cli
If you get a permission error, try with sudo:

Code: Select all

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

Code: Select all

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!
Congratulations! You've successfully run and modified your first React Native app.

Post Reply