有没有一种方法可以在不启动Android Studio的情况下运行模拟器。也许是从命令行。我知道这个功能在旧版本中是可用的,但从那以后就消失了。但也许有人已经知道怎么做了?
当前回答
你可以制作一个批处理文件,这将直接打开模拟器,而不需要打开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上
......\Android\sdk\tools\bin\avdmanager list avds
......\Android\sdk\tools\emulator.exe -avd Nexus_5X_API_27
试试这个
1. 完整的视频教程(适用于所有windows版本)
OR
2. 文本教程
Open the command prompt and change the directory where your sdk is placed D:\Softwares\Android\sdk\tools\bin> now add your avdmanager in this,now your full code is D:\Softwares\Android\sdk\tools\bin>avdmanager list avd it will show you a list of emulator device that you have already created after few seconds now typecd.. and run your emulator with this cmd, Here my emulator name is Tablet_API_25 so I have typed this name after the -avd. D:\Softwares\Android\sdk\tools>emulator -avd Tablet_API_25
编辑:对于Android Studio 3.2或更高版本,路径更改为D:\Softwares\Android\sdk\emulator\emulator -avd Tablet_API_25
例如:%ANDROID_HOME%\tools\emulator -avd [AVD NAME]
一张图胜过千言万语:)
如何从MAC终端启动AVD
模拟器的路径为
/Users/<Username>/AppData/Local/Android/sdk/tools
让它在Windows 10上工作:
C:\Users\UserName\AppData\Local\Android\Sdk\tools>emulator -list-avds
Nexus_5X_API_28
C:\Users\UserName\AppData\Local\Android\Sdk\emulator>emulator -avd Nexus_5X_API_28