当我尝试在Mac OS X上运行Android Emulator时,我得到'Command Not Found'

时间:2022-04-09 23:02:24

When I use the Mac OS X Terminal to navigate to the folder with my Android Emulator and type emulator, I get:

当我使用Mac OS X终端导航到我的Android模拟器和类型模拟器的文件夹时,我得到:

command not found

找不到命令

Here's what happens:

这是发生的事情:

$ emulator
-bash: emulator: command not found

How do I get it to work?

我如何让它工作?

3 个解决方案

#1


29  

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 (.):

当前目录通常不包含在OS X等* nix操作系统上的$ PATH中;要在当前目录中执行程序,在它前面加上当前目录(。)的路径:

$ ./emulator

#2


18  

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

可以使用Android Studio https://developer.android.com/studio/run/managing-avds.html添加模拟器

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

要启动模拟器:〜/ Library / Android / sdk / tools / emulator -avd Nexus_5X_API_23

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

相关问题:如何从命令行启动Android模拟器?

#3


1  

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.

打开Android Studio。单击AVD Manager(带有android和手机的图标)[示例图像:AVD Manager]。请参阅模拟器列表。如果你没有,你应该看到类似“安装模拟器”的东西。

Once this is successful, you'll get the tools folder downloaded to your ~/Library/Android/sdk

一旦成功,您将把工具文件夹下载到〜/ Library / Android / sdk

That is the folder you want, because it has the android and emulator command line tools.

那是你想要的文件夹,因为它有android和emulator命令行工具。

#1


29  

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 (.):

当前目录通常不包含在OS X等* nix操作系统上的$ PATH中;要在当前目录中执行程序,在它前面加上当前目录(。)的路径:

$ ./emulator

#2


18  

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

可以使用Android Studio https://developer.android.com/studio/run/managing-avds.html添加模拟器

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

要启动模拟器:〜/ Library / Android / sdk / tools / emulator -avd Nexus_5X_API_23

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

相关问题:如何从命令行启动Android模拟器?

#3


1  

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.

打开Android Studio。单击AVD Manager(带有android和手机的图标)[示例图像:AVD Manager]。请参阅模拟器列表。如果你没有,你应该看到类似“安装模拟器”的东西。

Once this is successful, you'll get the tools folder downloaded to your ~/Library/Android/sdk

一旦成功,您将把工具文件夹下载到〜/ Library / Android / sdk

That is the folder you want, because it has the android and emulator command line tools.

那是你想要的文件夹,因为它有android和emulator命令行工具。