Categories
Android React-Native

No emulators found as an output of emulator -list-avds

I got this error when running react-native app by running the command: npx react-native run-android

error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch

Checking adb device running and the command not found.

adb devices
zsh: command not found: adb

The solution for Mac user is to edit .zshrc by add following:

# fix adb command not found
alias adb='/Users/softmastx/Library/Android/sdk/platform-tools/adb'

# fix No emulators found
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

Save it and don’t forget to restart zsh for the changes to take effect!

source ~/.zshrc

Ref: https://stackoverflow.com/questions/38577669/run-react-native-on-android-emulator

https://stackoverflow.com/questions/7609270/not-able-to-access-adb-in-os-x-through-terminal-command-not-found