cur*_*4so 5 android android-emulator
正如指出如何创建带有命令行和avdmanager Android虚拟设备? 原则上可以从命令行创建AVD.虽然这不是直截了当的.在文档之后,应该有一个选项-t,可以指定哪个特定设备尝试使用targetId进行模拟.不幸的是,从版本25.3.1开始,avdmanager无法识别选项-t.有一个选项--tag但它似乎不是-t等价的,因为它不识别提供的targetId(取自列表).
如何指定我想要模拟的设备?
cd $ANDROID_HOME/tools/bin
yes | ./sdkmanager emulator
export PATH="${ANDROID_HOME}/emulator:${PATH}"
./sdkmanager "system-images;android-25;google_apis;x86"
yes | ./sdkmanager --licenses
./avdmanager list device
./avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"
cd $ANDROID_HOME/tools
sudo apt-get install cpu-checker
kvm-ok
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
./emulator -avd test
Run Code Online (Sandbox Code Playgroud)
例如 echo "no" | avdmanager --verbose create avd --force --name x86 --device "4in WVGA (Nexus S)" --package "system-images;android-24;google_apis;x86" --tag "google_apis" --abi "x86"
哪里:
Usage:
avdmanager [global options] create avd [action options]
Global options:
-s --silent : Silent mode, shows errors only.
-v --verbose : Verbose mode, shows errors, warnings and all messages.
--clear-cache: Clear the SDK Manager repository manifest cache.
-h --help : Help on a specific command.
Action "create avd":
Creates a new Android Virtual Device.
Options:
-a --snapshot: Place a snapshots file in the AVD, to enable persistence.
-c --sdcard : Path to a shared SD card image, or size of a new sdcard for
the new AVD.
-g --tag : The sys-img tag to use for the AVD. The default is to
auto-select if the platform has only one tag for its system
images.
-p --path : Directory where the new AVD will be created.
-k --package : Package path of the system image for this AVD (e.g.
'system-images;android-19;google_apis;x86'). [required]
-n --name : Name of the new AVD. [required]
-f --force : Forces creation (overwrites an existing AVD)
-b --abi : The ABI to use for the AVD. The default is to auto-select the
ABI if the platform has only one ABI for its system images.
-d --device : The optional device definition to use. Can be a device index
or id.
Run Code Online (Sandbox Code Playgroud)
小智 5
avdmanager 工具和 sdkmanager 在 Android SDK 工具包(25.3.0 及更高版本)中提供,位于 {your_android_sdk_directory}/tools/bin/ 中,在终端中运行以下命令:
Pixel是我给avd起的名字。
“system-images;android-26;google_apis;x86_64”从已安装软件包中的 ./sdkmanager 列表中获取
“17”是从 ./avdmanager list device 获取的设备 ID
将目录更改为:
要打开模拟器运行命令:
Pixel 是之前为 avd 指定的名称。
希望它可以帮助其他人使用新版本。
您可以使用新的sdkmanager命令行工具下载 Android 模拟器,并通过新的avdmanager命令行工具创建 AVD。使用 Android Studio AVD 管理器可以更轻松地完成这些任务。
| 归档时间: |
|
| 查看次数: |
7712 次 |
| 最近记录: |