我正在运行最新版本的Mac OS,并且我想通过命令行工具运行android仿真器。我已在Mac终端上运行以下命令,并收到以下错误。
$ emulator -list-avds
Pixel_XL_API_28
$ emulator -avd Pixel_XL_API_28
PANIC: Missing emulator engine program for 'x86' CPU.
我还运行带有以下可用选项的命令,该选项在官方documentation developer.android.com上也可用
$ /Users/janedoe/Library/Android/sdk/emulator/emulator -avd Pixel_XL_API_28 -netdelay none -netspeed full
我需要做的是,所以我不必每次只打开模拟器就打开android studios。
答案 0 :(得分:1)
请在Mac终端中按照步骤操作
Step 1 ( Add Environment Variable )
export ANDROID_HOME=/Users/$(whoami)/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
Step 2 ( .bash_profile / .bashrc )
Reload you .bash_profile Or .bashrc depending on OS
Step 3 ( go to emulator directory )
cd /Users/$(whoami)/Library/Android/sdk/emulator
Step 4 ( Get all list of Advs )
emulator -list-avds
Step 5 ( Run your Emulator Command Mode )
emulator -avd Nexus_5_API_22_Android_5.1
答案 1 :(得分:0)
在这里看看:Android Emulator Error Message: "PANIC: Missing emulator engine program for 'x86' CPUS."
然后按cmd进行以下操作:
(仿真器的路径)-C:\ Users \ user \ AppData \ Local \ Android \ Sdk \ emulator>
(仿真器名称)-emulator.exe @ Nexus_5 -dns-server 8.8.8.8-可写系统