DEV Community

Subham Kumar
Subham Kumar

Posted on

Complete Guide: Setting up React Native CLI for Android on macOS (2025 Edition)

If you’re on macOS and want to develop React Native apps using the CLI (not Expo), this guide walks you through everything — from installing Java to running your first Android emulator and building an APK.

`🧩 Prerequisites

You’ll need:

macOS (Intel or Apple Silicon)

Node.js & npm installed

Terminal (zsh or bash)`

⚙️ Step 1 — Install Watchman

Watchman is a file watcher used by React Native to track code changes.

brew install watchman
Enter fullscreen mode Exit fullscreen mode

Verify installation:

watchman --version
Enter fullscreen mode Exit fullscreen mode

Step 2 — Install OpenJDK 17 (via Zulu)

brew install --cask zulu@17
Enter fullscreen mode Exit fullscreen mode

React Native requires Java for Android builds.
The Zulu distribution is stable and widely recommended.

Verify:

 java -version
Enter fullscreen mode Exit fullscreen mode

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

Step 3 — Install React Native CLI

npm install -g react-native-cli
Enter fullscreen mode Exit fullscreen mode

react-native --version

Step 4 — Install Android Studio (Recommended)

Although you can install SDKs manually, using Android Studio is the easiest and most reliable way.

Option 1 (Recommended UI method)
Download from
👉 https://developer.android.com/studio

  1. Choose the macOS (Apple Silicon or Intel) version.

  2. Open .dmg → drag Android Studio to Applications.

  3. Launch it → follow the Standard installation wizard.

  4. It will install:

    • Android SDK
    • Platform Tools (adb)
    • Emulator
    • Build Tools

Accept all SDK licenses when prompted.

Option 2: Install Android Studio via Homebrew Cask (semi-automated)

You can install the Android Studio app itself using Homebrew, but you’ll still need to open it once to complete SDK & emulator setup.

Steps:

brew install --cask android-studio

Enter fullscreen mode Exit fullscreen mode

Then open it once:

open -a "Android Studio"
Enter fullscreen mode Exit fullscreen mode

Inside the Android Studio UI:

Choose Standard Installation

Accept all SDK licenses

Wait for SDK, Platform Tools, and Emulator to install

After that, you can manage SDKs & virtual devices (AVDs) from command line later

Step 5 — Confirm SDK Location

Open Android Studio →
Preferences → Appearance & Behavior → System Settings → Android SDK

You’ll see something like:
/Users/<your-username>/Library/Android/sdk

That’s your $ANDROID_HOME.

🌿 Step 6 — Add Environment Variables

Open Terminal and run:

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
Enter fullscreen mode Exit fullscreen mode

Verify:

echo $ANDROID_HOME
adb --version
sdkmanager --list | head
Enter fullscreen mode Exit fullscreen mode

Step 7 — Create an Android Emulator

Open Android Studio → Tools → Device Manager → Create Device
Then:

Select a Pixel device (e.g. Pixel 7)

Choose a system image (Android 13 or 14 recommended)

Download → Next → Finish

Click ▶️ (Play) to launch the emulator

Once it boots up, verify via terminal:
adb devices

✅ You should see:
emulator-5554 device

Step 8 — Run Your React Native App
Inside your project folder:

cd your-project
npx react-native run-android

This will:

Build the app using Gradle

Install it on your running emulator

Launch it automatically 🎉

To generate an APK file:
cd android
./gradlew assembleDebug

You’ll find your APK here:
android/app/build/outputs/apk/debug/app-debug.apk

You can install it on any Android phone:
adb install app-debug.apk

Top comments (0)