emulator -avd <nameOfYourAvdEmulator>
使用以下命令查找模拟器的名称avdmanager list avd
:
avdmanager list avd
Name: Nexus_5X_API_23_Android_6.0
Device: Nexus 5X (Google)
Path: /Users/edward3/.android/avd/Nexus_5X_API_23_Android_6.0.avd
Target: Google APIs (Google Inc.)
Based on: Android 6.0 (Marshmallow) Tag/ABI: google_apis/x86
Skin: nexus_5x
Sdcard: 512M
如果缺少,请添加到您的 ~/.profile 中:
# Add to your ~/.profile PATH to easily run emulator and avdmanager commands
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
# Create alias to run your favorite Android emulator
alias avd-run='emulator -avd Nexus_5X_API_23_Android_6.0 &'
打开一个新终端或用于source ~/.profile
重新加载对您所做的更改~/.profile
使用您创建的别名启动您最喜欢的模拟器:
avd-run