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

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

Posted by: admin April 23, 2020 Leave a comment

Questions:

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?

How to&Answers:

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

Answer:

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?

Answer:

Open 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.