Error on Running Android Emulator: Spawn Adb Enoent

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 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!

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.