1

I use mac and setting up the development environment by React Native CLI Quickstart. https://reactnative.dev/docs/environment-setup

It works for me in ios but in android i'm getting an error.

My steps:

1.open ~/.zshrc

2.add to the file

> export ANDROID_HOME=$HOME/Library/Android/sdk export
> PATH=$PATH:$ANDROID_HOME/emulator export
> PATH=$PATH:$ANDROID_HOME/tools export
> PATH=$PATH:$ANDROID_HOME/tools/bin export
> PATH=$PATH:$ANDROID_HOME/platform-tools
  1. save and run source ~/.zshrc 4.open emulator, run yarn android and getting the error:

/bin/sh: adb: command not found.

error Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds.

warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT error Failed to start the app. Error: spawnSync adb ENOENT at Object.spawnSync (internal/child_process.js:1070:20)

** when i run "emulator -list-avds" i can see the emulator

Barak
  • 654
  • 13
  • 30

1 Answers1

2

Run the below three commands before running npm run android

export ANDROID_HOME=/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
Sourav Dey
  • 1,051
  • 1
  • 13
  • 21