LinuxCommandLibrary

react-native

Build native mobile apps using React

TLDR

Create new project

$ npx react-native init [ProjectName]
copy
Start Metro bundler
$ npx react-native start
copy
Run on Android
$ npx react-native run-android
copy
Run on iOS
$ npx react-native run-ios
copy
Run on specific device
$ npx react-native run-ios --device "[iPhone 15]"
copy
Clean build cache
$ npx react-native start --reset-cache
copy
Link native dependencies
$ npx react-native link
copy
Show doctor diagnostics
$ npx react-native doctor
copy

SYNOPSIS

npx react-native command [options]

DESCRIPTION

react-native is the command-line interface for React Native, a framework that enables building native iOS and Android mobile applications using JavaScript and React. It manages the full development lifecycle from project creation through building, running, and debugging apps on simulators, emulators, and physical devices.
The CLI starts the Metro bundler, which serves JavaScript bundles to running apps and enables hot reloading for rapid development iteration. Platform-specific commands (run-android, run-ios) compile native code and deploy to target devices. The doctor command verifies that the development environment is correctly configured, checking for Xcode, Android SDK, Node.js, and required dependencies.

PARAMETERS

init NAME

Create new project.
start
Start Metro bundler.
run-android
Build and run on Android.
run-ios
Build and run on iOS.
doctor
Check development environment.
link
Link native dependencies.
upgrade
Upgrade React Native.
--device NAME
Target device.
--reset-cache
Clear bundler cache.

CAVEATS

iOS development requires macOS. Android needs SDK and emulator. Native builds can be slow.

HISTORY

React Native was created by Facebook and released in 2015. It enables building mobile apps using React and JavaScript, compiling to native code.

SEE ALSO

expo(1), npm(1), metro(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community