When I use the Mac OS X Terminal to navigate to the folder with my Android Emulator and type emulator, I get:
command not found
Here's what happens:
$ emulator
-bash: emulator: command not found
How do I get it to work?
When I use the Mac OS X Terminal to navigate to the folder with my Android Emulator and type emulator, I get:
command not found
Here's what happens:
$ emulator
-bash: emulator: command not found
How do I get it to work?
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?
steps
emulator# soft link
$ ln -s ~/Library/Android/sdk/tools/emulator /usr/local/bin/emulator
# check all avd
$ emulator -list-avds
$ emulator @avd_name
# OR
$ emulator -avd avd_name
# zsh
$ vim ~/.zshrc
# OR
$ code ~/.zshrc
.zshrc file# export ANDROID_SDK_ROOT=/Users/xgqfrms/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Library/Android/sdk
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_AVD_HOME=~/.android/avd
# flush update
$ source ~/.zshrc
https://developer.android.com/studio/run/emulator-commandline
These 3 command works for me on VS Code Terminal (Mac Book Pro M1)
echo 'export PATH=$PATH:~/Library/Android/sdk/emulator/' >> ~/.bash_profilesource ~/.bash_profileemulator -list-avdsOpen Android Studio. Click on AVD Manager (the icon with the android and phone) [example image: AVD Manager]. See the list of emulators. You should see something like "Install Emulator" if you don't have any.
Once this is successful, you'll get the tools folder downloaded to your ~/Library/Android/sdk
That is the folder you want, because it has the android and emulator command line tools.
typcally i use from terminal :
./Library/Android/sdk/emulator/emulator *some action*