Skip to main content
The React Native CLI is your primary tool for creating, running, building, and managing React Native applications from the command line.

Installation

The React Native CLI is included when you create a new project. You can run commands using npx:
npx react-native <command> [options]

Available Commands

Project Initialization

  • init - Create a new React Native project

Development

  • start - Start the Metro development server
  • run-android - Build and run your app on Android
  • run-ios - Build and run your app on iOS

Building

Debugging

Configuration

Basic Workflow

1

Create a project

npx react-native init MyApp
2

Navigate to project

cd MyApp
3

Start Metro

npx react-native start
4

Run on device

In a new terminal:
npx react-native run-ios
# or
npx react-native run-android

Global Options

Most commands support these common options:
OptionDescription
--versionShow version number
--helpShow help information
--verboseIncrease logging verbosity
--config <path>Path to the CLI configuration file

CLI Configuration

You can configure CLI behavior using a react-native.config.js file in your project root:
react-native.config.js
module.exports = {
  project: {
    ios: {},
    android: {},
  },
  assets: ['./assets/fonts/'],
};

Environment Variables

Metro Port

RCT_METRO_PORT=8088 npx react-native start

Skip Package Manager

SKIP_INSTALL=true npx react-native init MyApp

Troubleshooting

Clear Cache

If you encounter bundling issues:
npx react-native start --reset-cache

Check CLI Version

npx react-native --version

Verbose Logging

For detailed output during debugging:
npx react-native run-android --verbose

Next Steps

Start Command

Learn how to start the Metro development server

Run Commands

Build and run your app on simulators and devices

Bundle Command

Create production JavaScript bundles

Metro Config

Configure the Metro bundler

Build docs developers (and LLMs) love