有没有一种方法可以在不启动Android Studio的情况下运行模拟器。也许是从命令行。我知道这个功能在旧版本中是可用的,但从那以后就消失了。但也许有人已经知道怎么做了?


当前回答

在windows上

......\Android\sdk\tools\bin\avdmanager list avds

......\Android\sdk\tools\emulator.exe -avd Nexus_5X_API_27

其他回答

在ANDROID_HOME文件夹中有一个tools文件夹

在Mac / Linux <avd > > 在Windows 模拟器。exe -avd <avdName>

如果你正在使用API 24,你可以从列表中获得模拟器的名称 Android列表avds 如果你正在使用API 25,那么你将在工具\bin中获得avdmanager Avdmanager列出avds

你可以制作一个批处理文件,这将直接打开模拟器,而不需要打开Android Studio。如果你使用的是Windows:

Open Notepad New file Copy the next lines into your file: cd /d C:\Users\%username%\AppData\Local\Android\sdk\tools emulator @[YOUR_EMULATOR_DEVICE_NAME] Notes: Replace [YOUR_EMULATOR_DEVICE_NAME] with the device name you created in emulator To get the device name go to: C:\Users\%username%\AppData\Local\Android\sdk\tools Run cmd and type: emulator -list-avds Copy the device name and paste it in the batch file Save the file as emulator.bat and close Now double click on emulator.bat and you got the emulator running!

Windows用户:

复制模拟器名称。 进入以下目录:C:\Users\[yourusername]\AppData\Local\Android\Sdk\emulator 右键单击模拟器.exe并将其作为快捷方式发送到您想要的位置。 右键单击快捷方式的.exe文件,并添加您的模拟器名称,只是复制到目标文本框的@符号。 双击快捷方式,完成!

C: \ \用户[yourusername] \ AppData \ Local模拟器Android Sdk \ \ . exe模拟器@EmulatorName

我已经安装了工作室。但是不需要启动(不安装)Android Studio,您可以直接启动模拟器

C: Users\ AppData\Local\Android\Sdk\tools\模拟器.exe -netdelay没有-netspeed full - avd_name

列出您拥有的模拟器

~/Library/Android/sdk/tools/emulator -list-avds

例如,我有这个Nexus_5X_API_24

运行模拟器的命令是

cd ~/Library/Android/Sdk/tools && ./emulator -avd Nexus_5X_API_24