Skip to main content
The run-android command builds your Android app and runs it on a connected device or emulator.

Usage

Make sure you have an Android emulator running or a device connected via USB with USB debugging enabled.

Options

Examples

Basic Usage

Builds debug variant and runs on the first available device/emulator.

Specific Device

Runs on a device named “Pixel 5”.

List Devices

Outputs:

Run on Specific Device ID

Release Build

Builds and runs the release variant (useful for testing production builds).

Custom Variant

Runs a custom build variant defined in your build.gradle.

Custom Metro Port

Without Packager

Use this when Metro is already running in another terminal.

Verbose Output

Shows detailed Gradle build output for debugging.

Fast Build for Device

Builds only for the connected device’s architecture, significantly speeding up builds.

Build Variants

By default, React Native creates these variants:

Debug

  • Developer menu enabled
  • Remote debugging enabled
  • Not optimized or minified
  • Connects to Metro bundler

Release

  • Optimized and minified
  • No developer tools
  • Requires signing configuration
  • Uses bundled JavaScript

Custom Variants

Define custom variants in android/app/build.gradle:
android/app/build.gradle
Run with:

Common Workflows

First Time Setup

1

Start Android emulator

Open Android Studio > AVD Manager > Start emulatorOr from command line:
2

Run the app

Development with Physical Device

1

Enable USB Debugging

On your Android device:
  1. Go to Settings > About phone
  2. Tap Build number 7 times
  3. Go to Settings > Developer options
  4. Enable USB debugging
2

Connect device

Connect via USB and verify:
3

Run the app

Testing Release Build

Environment Variables

Android SDK Location

Gradle Options

Troubleshooting

SDK Not Found

Error: SDK location not found Solution: Create android/local.properties:

Device Not Detected

Error: No connected devices Solution:

Build Failed

Error: Execution failed for task ':app:installDebug' Solution:

Metro Connection Failed

Error: Red screen “Unable to load script” Solution:

Build Too Slow

Solution: Add to android/gradle.properties:
Or use active arch only:

Installed Build is Old

Solution:

Build Configuration

Signing Release Build

Edit android/app/build.gradle:
android/app/build.gradle

Performance Tips

Use architecture-specific builds:
Enable Gradle daemon in android/gradle.properties:

Next Steps

Build Android

Build APK/AAB for distribution

Android Logs

View device logs for debugging

Running on Device

Complete guide for physical devices

Android Setup

Configure Android development environment