buymeasoda RefDocs
  • Overview
  • General
    • Android
    • Apache
    • Fish
    • Git
    • Github
    • Gmail
    • Homebrew
    • iOS
    • iTerm
    • MacOS
    • MacPorts
    • Mamp
    • Media
    • Mercurial
    • MySQL
    • Node
    • npm
    • nvm
    • Obsidian
    • PHP
    • React Native
    • Rust
    • Server
    • Slack
    • Sourcegraph
    • Tools
    • Vim
    • VS Code
    • Yarn
  • Unix
    • Checksum and hash utilities
    • Command line history
    • Command line keyboard shortcuts
    • Compress files and folders
    • Crontab
    • Diff files and folders
    • Disk usage and file sizes
    • Find and search files
    • Firewall configuration
    • Help and manual pages
    • HostName and Local HostName for Mac OSX
    • Navigating the file system
    • Network, domains and routing
    • Run and manage background tasks
    • Secure FTP SFTP and Secure Copy SCP
    • Secure Shell SSH
    • Sync files and folders
    • System and process management
    • System and user information
    • Useful characters
    • Useful commands
    • User, file and group permissions
    • Working with cURL
    • Working with files and directories
    • Working with text
Powered by GitBook
On this page
  • React Native
  • Setup Overview
  • Base Setup
  • Android Setup
  • iOS Setup
  • React Native CLI
  • Projects
  • Create Project
  • Run Server
  • Install and Run App
  • Emulator / Simulator Commands
  • Android Tips
  • iOS Tips
  1. General

React Native

PreviousPHPNextRust

Last updated 2 years ago

React Native

Setup Overview

Development Tools

Base Setup

Install base environment

brew install node
brew install watchman

Android Setup

Install Java 11 JDK

brew install --cask homebrew/cask-versions/zulu11

Install Android Studio

brew install --cask android-studio

Android environment setup instructions

  • https://reactnative.dev/docs/environment-setup

  • Refer to: React Native CLI Quickstart -> macOS -> Android

iOS Setup

Install iOS environment

  • Manually install Xcode via the Apple App Store

Install Cocoapods (iOS)

sudo gem install cocoapods

iOS environment setup instructions

  • https://reactnative.dev/docs/environment-setup

  • Refer to: React Native CLI Quickstart -> macOS -> iOS

React Native CLI

Run React Native CLI commands

npx react-native <command>

Show system and React Native info

npx react-native info

Projects

Create Project

Initialize new project

npx react-native init <app-name>
cd <app-name>

Run Server

Start server (and optionally reset cache)

npx react-native start
npx react-native start --reset-cache

Install and Run App

Build, install and run app on iOS Simulator / Android Emulator

npx react-native run-ios
npx react-native run-android

Emulator / Simulator Commands

Show development / debug menu

  • CMD + M (Android)

  • CMD + D (iOS)

  • Shake (Hardware Device)

Reload application

  • R + R (Android)

  • R (iOS)

Android Tips

Unable to connect to remote debugger

Open in browser first

http://localhost:8081/debugger-ui/

Configure reverse socket connection for react native server

adb reverse tcp:8081 tcp:8081

iOS Tips

Install pods (run from within project directory)

npx pod-install
Xcode
Xcode Command Line Tools
CocoaPods
Android Studio
Node
Watchman
OpenJDK