Skip to content

React Native - Running Android

To run your React Native app on an Android device or emulator, you need to have your environment set up correctly (Node.js, JDK, Android Studio, Android SDK, and environment variables).

  1. Ensure Android Studio is installed and you have at least one Android Virtual Device (AVD) configured in the AVD Manager.
  2. Start your chosen AVD from Android Studio.
  3. Open your terminal, navigate to your React Native project’s root directory.
  4. Run the command:
npx react-native run-android

Or, if you prefer using Yarn:

yarn react-native run-android

This command will build your app and install it on the running emulator. The Metro bundler (JavaScript bundler) will also start in a separate terminal window. If the build is successful, the app will launch on your emulator.

  1. Enable USB Debugging on your Android device: Go to Settings > About phone, tap ‘Build number’ seven times to enable Developer Options. Then, go to Settings > Developer options and enable ‘USB debugging’.
  2. Connect your device to your computer via USB. Authorize your computer for debugging if prompted on the device.
  3. Verify your device is recognized by running adb devices in your terminal. You should see your device listed.
  4. Navigate to your React Native project’s root directory in the terminal.
  5. Run the same command as for the emulator:
npx react-native run-android

The app will be built and installed on your connected device.

Once your app is running, you can access the Developer Menu:

  • On an Android emulator: Press Cmd + M (macOS) or Ctrl + M (Windows/Linux).
  • On a physical device: Shake the device.

The Android Studio emulator has significantly improved and is generally recommended. However, Genymotion is another popular and performant Android emulator you can use.

Troubleshooting: If you encounter issues, ensure your Android SDK paths are correctly configured in environment variables (ANDROID_HOME or ANDROID_SDK_ROOT) and that you have the necessary SDK Platforms and Build-Tools installed via Android Studio’s SDK Manager. Refer to the official React Native Environment Setup guide for detailed instructions.