Saturday, 10 October 2020

React Native Development Environment Setup

 I choose to setup the react native development environment for iOS first since I already have Xcode installed.

  • React Native CLI (not using Expo since I may need to use native code)
  • React Native with TypeScript

Target OS: iOS

Dependencies:
  • Node : already installed v12.9.0 using nvm v6.14.8
  • Watchman: su admin; brew install watchman
  • Xcode with command line tools : already installed
  • Cocoapods: already installed
Create react native project.
npx react-native init <project> --template react-native-template-typescript

Run Metro
cd ~/<project>; npx react-native start

Run iOS App
cd ~/<project>; npx react-native run-ios

Target OS: Android

Dependencies:
  • brew cask install adoptopenjdk/openjdk/adoptopenjdk8
  • Install Android Studio
    • Android SDK Platform 29
    • Google APIs Intel x86 Atom System Image
    • Android SDK Build-Tools select 29.0.2
  • Add ANDROID_HOME environment variable to .profile and add PATH.
Run Metro
cd ~/<project>; npx react-native start

Run Android App
cd ~/<project>; npx react-native run-android

No comments:

Post a comment