I get 'Command Not Found' when I try to run Android Emulator on Mac OS X I get 'Command Not Found' when I try to run Android Emulator on Mac OS X android android

I get 'Command Not Found' when I try to run Android Emulator on Mac OS X


The current directory is not normally included in your $PATH on a *nix operating system like OS X; to execute a program in the current directory, precede it with the path to the current directory (.):

$ ./emulator


Emulator can be added with Android Studio https://developer.android.com/studio/run/managing-avds.html

To start emulator: ~/Library/Android/sdk/tools/emulator -avd Nexus_5X_API_23

Related question: How do I launch the Android emulator from the command line?


solutions

steps

  1. create one symbolic link emulator
# soft link$ ln -s ~/Library/Android/sdk/tools/emulator /usr/local/bin/emulator
  1. call the command
# check all avd$ emulator -list-avds$ emulator @avd_name# OR$ emulator -avd avd_name

enter image description here

2. system environment

  1. edit env with vim/vscode
# zsh$ vim  ~/.zshrc# OR$ code  ~/.zshrc
  1. add below lines to the .zshrc file
# export ANDROID_SDK_ROOT=/Users/xgqfrms/Library/Android/sdkexport ANDROID_SDK_ROOT=~/Library/Android/sdkexport ANDROID_HOME=~/Library/Android/sdkexport ANDROID_AVD_HOME=~/.android/avd
  1. update config
# flush update$ source ~/.zshrc

refs

https://developer.android.com/studio/run/emulator-commandline