Error on Running Android Emulator: Spawn Adb Enoent
I Created a New React Native App by Using the Expo Cli. iOS Xcode Emulator Is Working Fine but Getting Below Error for Android Emulator Error: Spawn Adb Enoent...
I created a new react native app by using the expo cli. iOS Xcode Emulator is working fine but getting below error for android emulator
Error: spawn adb ENOENT
I tried to uninstall and install back expo-cli. Tried to delete the emulator and create a new one. None of them is working.
1 Answer
I was in your same situation wherein I’d just installed expo and tried to run the app in an emulator on my Mac.
Apparently the problem was that ANDROID_HOME and adb weren’t set in my $PATH.
I solved it by referring to Option 3 (I already had android studio installed) of the top voted answer here. In case you want to know what I did, I use ohmyzsh by default so I did the following:
nano .zshrc
Add these two lines in the .zshrc file.
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Then run this in your terminal:
source ~/.zshrc
Restart your terminal and now everything works!