This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

Android Studio Emulator

Edit page

Learn how to set up the Android Emulator to test your app on a virtual Android device.


If you don't have an Android device available to test with, we recommend using the default emulator that comes with Android Studio. If you run into any problems setting it up, follow the steps in this guide.

Install JDK

Prerequisites

Use a package manager such as Homebrew to install the following dependency.

Install dependencies

1

Installing Watchman is only required for projects on SDK 55 and earlier.

Install Watchman using a tool such as Homebrew:

Terminal
brew install watchman

2

Install OpenJDK distribution called Azul Zulu using Homebrew. This distribution offers JDKs for both Apple Silicon and Intel Macs.

Run the following commands in a terminal:

Terminal
brew install --cask zulu@17

After you install the JDK, add the JAVA_HOME environment variable in ~/.bash_profile (or ~/.zshrc if you use Zsh):

export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home

Set up Android Studio

1

Download and install Android Studio.

2

Open the Android Studio app. On the first launch, the Android Studio Setup Wizard appears. Click Next on the Welcome screen. Then, under Install Type, select Standard and click Next.

Verify the settings and click Next. Then, accept the license agreement and click Next again. The wizard downloads and installs the Android SDK and its tools. Click Finish when the installation completes.

3

By default, Android Studio will install the latest version of the Android SDK. However, Android 16 (Baklava) SDK is required to compile a React Native app.

Open Android Studio, go to Settings > Languages & Frameworks > Android SDK. From the SDK Platforms tab, and under Android 16 (Baklava), select Android SDK Platform 36 and Sources for Android 36.

4

Then, click on the SDK Tools tab and make sure you have at least one version of the Android SDK Build-Tools and Android Emulator installed.

5

Copy or remember the path listed in the box that says Android SDK Location.

6

Add the following lines to your /.zprofile or ~/.zshrc (if you are using bash, then ~/.bash_profile or ~/.bashrc) config file:

Terminal
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools

7

Reload the path environment variables in your current shell:

Terminal
# for zsh
source $HOME/.zshrc

# for bash
source $HOME/.bashrc

8

Finally, make sure that you can run adb from your terminal.

Troubleshooting: Android Studio not recognizing JDK

If Android Studio doesn't recognize your homebrew installed JDK, you can create a Gradle configuration file to explicitly set the Java path:

  1. Create a Gradle properties file in your home directory:

    Terminal
    touch ~/.gradle/gradle.properties
  2. Add the following line to the gradle.properties file, replacing the path with your actual Java installation path:

    gradle.properties
    java.home=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
  3. If you have an existing .gradle folder in your project directory, delete it and reopen your project in Android Studio:

    Terminal
    rm -rf .gradle

This should resolve issues with Android Studio not detecting your JDK installation.

Set up an emulator

1

On the Android Studio main screen, click More Actions, then Virtual Device Manager in the dropdown.

2

Click Create virtual device.

3

Under Add device, choose the type of hardware you'd like to emulate. We recommend testing against a variety of devices, but if you're unsure where to start, the newest device in the Pixel line could be a good choice.

4

Select an OS version to load on the emulator (probably one of the system images), and download the image (if required).

5

Change any other settings you'd like, and press Finish to create the emulator. You can now run this emulator anytime by pressing the Play button in the Device Manager window.

Troubleshooting

Multiple adb versions

Having multiple adb versions on your system can result in the following error:

Terminal
adb server version (xx) doesn't match this client (xx); killing...

This is because the adb version on your system is different from the adb version on the Android SDK platform-tools.

1

Open the terminal and check the adb version on the system:

Terminal
adb version

2

And from the Android SDK platform-tool directory:

Terminal
cd ~/Library/Android/sdk/platform-tools
./adb version

3

Copy adb from Android SDK directory to usr/bin directory:

Terminal
sudo cp ~/Library/Android/sdk/platform-tools/adb /usr/bin

How do I install a specific version of Expo Go?

You can create a project with the desired SDK version and open it in a simulator to install the matching version of Expo Go.

Terminal
# Bootstrap an SDK 57 project
npx create-expo-app --template blank@57

# Open the app on a simulator to install the required Expo Go app
npx expo start --android

Alternatively, you can download a specific version of Expo Go with the expo-go CLI by passing an SDK version, or use latest for the latest SDK version. This command downloads the Expo Go app to the current directory and caches it under ~/.expo.

Terminal
npx expo-go download android latest