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

只愿长相守 提交于 2020-01-03 06:45:16

问题


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?


回答1:


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



回答2:


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?




回答3:


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.



来源:https://stackoverflow.com/questions/10269274/i-get-command-not-found-when-i-try-to-run-android-emulator-on-mac-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!