Embarking on React Native development for Android on your macOS machine can seem daunting, but with the right guidance, it’s a straightforward process. This comprehensive guide will walk you through every essential step, from installing core dependencies like Java and Watchman to setting up your first Android emulator and building release-ready APKs directly from the command line interface (CLI) – no Expo needed! Get ready to unlock the full potential of native Android development with React Native.

🧩 Prerequisites

Before we begin, ensure you have the following in place:

  • macOS: An Intel or Apple Silicon Mac.
  • Node.js & npm: Already installed on your system.
  • Terminal: Your preferred terminal (zsh or bash).

⚙️ Step 1: Install Watchman

Watchman is a crucial file watcher developed by Facebook (now Meta) that React Native uses to detect code changes, enabling fast refresh and live reloading.

To install Watchman:

brew install watchman

Verify the installation:

watchman --version

⚙️ Step 2: Install OpenJDK 17 (via Zulu)

React Native for Android requires Java for building your applications. OpenJDK 17, specifically the Zulu distribution, is a stable and widely recommended choice.

Install Zulu OpenJDK 17:

brew install --cask zulu@17

Verify your Java installation:

java -version

You should see output similar to:

openjdk version "17.0.17" 2025-10-21 LTS
OpenJDK Runtime Environment Zulu17.62+17-CA

⚙️ Step 3: Install React Native CLI

The React Native command-line interface (CLI) is essential for creating and managing your native projects without Expo.

Install the CLI globally:

npm install -g react-native-cli

Confirm the CLI version:

react-native --version

⚙️ Step 4: Set Up Android Studio & SDKs (Recommended)

While manual SDK installation is possible, Android Studio offers the most convenient and reliable way to manage your Android SDKs, platform tools, and emulators.

Option 1: Recommended UI Method

  1. Download Android Studio: Visit 👉 https://developer.android.com/studio and download the macOS version (ensure you select the correct chip architecture: Apple Silicon or Intel).
  2. Install: Open the downloaded .dmg file and drag “Android Studio” into your Applications folder.
  3. Launch & Configure: Open Android Studio. Follow the Standard installation wizard. This process will automatically download and install:
    • Android SDK
    • Android SDK Platform-Tools (which includes adb)
    • Android Emulator
    • Android SDK Build-Tools
  4. Accept Licenses: Be sure to accept all SDK licenses when prompted during the installation.

Option 2: Install Android Studio via Homebrew Cask (Semi-Automated)

You can use Homebrew Cask to install the Android Studio application itself, but you’ll still need to perform the initial SDK setup within the UI.

Install Android Studio:

brew install --cask android-studio

Then, open it once to complete the setup:

open -a "Android Studio"

Inside the Android Studio UI:
* Choose Standard Installation.
* Accept all SDK licenses.
* Wait for the SDK, Platform Tools, and Emulator to finish installing.


⚙️ Step 5: Confirm Android SDK Location

It’s important to know where your Android SDK is installed, as this path will be used for environment variables.

  1. Open Android Studio.
  2. Navigate to Preferences (or Settings on some versions) → Appearance & BehaviorSystem SettingsAndroid SDK.

You will see the Android SDK Location, which typically looks like:

/Users/<your-username>/Library/Android/sdk

This path represents your $ANDROID_HOME.


🌿 Step 6: Add Environment Variables

To ensure your system can find the Android SDK tools (like adb, emulator, and sdkmanager), you need to add their paths to your shell’s environment variables. We’ll add them to ~/.zshrc (or ~/.bashrc if you use bash).

Open your Terminal and run the following commands:

echo 'export ANDROID_HOME=$HOME/Library/Android/sdk' >> ~/.zshrc
echo 'export PATH=$PATH:$ANDROID_HOME/emulator' >> ~/.zshrc
echo 'export PATH=$PATH:$ANDROID_HOME/platform-tools' >> ~/.zshrc
echo 'export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin' >> ~/.zshrc
source ~/.zshrc

The source ~/.zshrc command applies the changes immediately to your current terminal session.

Verify your environment variables:

echo $ANDROID_HOME
adb --version
sdkmanager --list | head

These commands should show the SDK path, the adb version, and a list of available SDK packages, respectively.


⚙️ Step 7: Create and Launch an Android Emulator

An Android Virtual Device (AVD), or emulator, is essential for testing your React Native apps without a physical device.

  1. Open Android Studio.
  2. Go to ToolsDevice ManagerCreate Device.
  3. Select a Device: Choose a Pixel device (e.g., Pixel 7) for a good developer experience.
  4. Choose System Image: Select a recommended system image like Android 13 or 14 (API Level 33 or 34). Download it if prompted.
  5. Finish: Click Next and then Finish to create the AVD.
  6. Launch Emulator: In the Device Manager, click the ▶️ (Play) button next to your newly created emulator to launch it.

Once the emulator boots up, verify it’s detected by adb in your terminal:

adb devices

You should see output similar to:

emulator-5554   device

⚙️ Step 8: Run Your React Native App & Generate APK

With your environment configured and an emulator running, you’re ready to build and run your React Native application.

Running on the Emulator

Navigate to your React Native project folder in the terminal:

cd your-project

Then, run the app on your Android emulator:

npx react-native run-android

This command will:
* Build your app using Gradle.
* Install it onto your running emulator.
* Launch the app automatically on the emulator.

Generating an APK File

To create a debug APK file that can be installed on any Android device:

  1. Navigate into the android directory within your project:
    bash
    cd android
  2. Execute the Gradle assemble command:
    bash
    ./gradlew assembleDebug

    This will compile your app into a debug APK.

You will find your generated APK file at:

android/app/build/outputs/apk/debug/app-debug.apk

To install this APK on a connected physical Android phone or another emulator (ensure only one device is connected or specify the device with adb -s <device-id> install):

adb install app-debug.apk

Congratulations! You have successfully set up your macOS environment for React Native Android development using the CLI, capable of running apps on emulators and generating APKs. Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed