有没有一种方法可以在不启动Android Studio的情况下运行模拟器。也许是从命令行。我知道这个功能在旧版本中是可用的,但从那以后就消失了。但也许有人已经知道怎么做了?
当前回答
如果你在系统上安装了Git。然后可以运行.sh bash代码。我创建的bash代码搜索从您创建的ADV设备,并列出他们。然后你可以选择adv设备的数量运行模拟器而不运行Android工作室。
链接: adv-emulator.sh
注意[windows操作系统]:请先添加%appdata%\..\Local\Android\Sdk\模拟器到您的系统环境路径,否则bash-code不工作。
其他回答
在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]
如果您正在启动Flutter应用程序的模拟器,则可以运行以下命令-
> flutter emulators --launch [Emulator ID]
在我的例子中,模拟器id是Pixel_2_API_29,因为我在Android studio中使用AVD管理器创建了它。这里的命令是-
> flutter emulators --launch Pixel_2_API_29
谢谢
一张图胜过千言万语:)
如何从MAC终端启动AVD
以下是我在windows中快速运行模拟器所做的: 我创建了一个这样的windows批处理文件:
start C:\Users\{Username}\AppData\Local\Android\Sdk\tools\emulator.exe -avd {Emulator_Name}
每次需要模拟器时运行批处理文件。