Skip to content

React Native Notes

Chris edited this page Jan 27, 2018 · 1 revision

Setting up react-native

iOS setup

  • Xcode needs to be installed.
  • Node.js >= 4.5 needs to be installed.
  • Install watchman via Homebrew
brew install watchman
  • Install react-native as a global package on the local system
npm install -g react-native-cli

To setup initial project / app, run the below command

react-native init kegcopr

Android setup

  • Install Java SDK / JDK
  • Install Node.js
  • Install Python 2.x
  • search for Android Studio download
  • Install Android Studio
  • Install react-native
npm install -g react-native-cli

Bootstrap the project

react-native init <projec-name>

Android Studio / emulator setup

Create an environment variable called JAVA_HOME

⚠️ the JAVA_HOME is not required.

Add the Android platform-tools to the PATH

Running a react-native app

iOS

react-native run-ios

The app should also be able to run within Xcode,

iOS - Xcode

Open ios/mr-fancy-pants.xcodeproj with Xcode

  • To launch the app in the Simulator Click the Run button in the Xcode interface

Android

To run the app on Android

react-native run-android

⚠️ Make sure the Android emulator is running already from Android Studio

Clone this wiki locally