如何使用硬件配置文件从命令行创建AVD? [英] How to create AVD from command line using a hardware profile?

查看:152
本文介绍了如何使用硬件配置文件从命令行创建AVD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我一直通过Android Studio UI(位于工具>上)管理AVD.AVD经理.这适用于创建具有特定硬件配置文件(我在XML文件中具有)的AVD,但是我发现AVD经常以某种方式损坏.AVD旁边是一个修复"窗口.使用者介面中的[选项],而我新增的硬体设定档会被移除,导致我再次输入所有内容.这很痛苦而且很频繁,所以我想通过命令行将其自动化.

Currently I've been managing AVDs via the Android Studio UI at Tools > AVD Manager. This works for creating an AVD with a specific hardware profile (that I have in an XML file), but I find that frequently an AVD is breaking somehow. Next to the AVD is a "Repair" option in the UI, and the hardware profile I've added gets removed, causing me to enter it all in again. This is painful and frequent so I'd like to automate it via the command line.

我可以使用像 avdmanager create avd -n test1 -k"system-images; android-29; google_apis; x86" 这样的命令来创建AVD,但是它会提示您输入自定义硬件,并且如果我选择一个自定义硬件配置文件,它会提示我输入每个单独的属性.这比使用UI更为耗时.

I can create an AVD using a command like avdmanager create avd -n test1 -k "system-images;android-29;google_apis;x86", but it prompts for custom hardware, and if I choose a custom hardware profile it prompts me to enter in each individual property. This is more time-consuming than using the UI.

此来源声明"Android工具可让您设置虚拟设备的硬件仿真选项",并提供了不错的属性列表,这些属性无法修改,但没有说明如何通过命令设置这些属性.

This source claims "the android tool lets you set hardware emulation options for virtual device", and provides a nice list of properties than can be modified, but no explanation of how these can be set via a command.

是否可以通过命令行设置AVD的硬件配置文件,而无需手动回答提示?

Is there some way to set the hardware profile for an AVD from the command line without manually answering prompts?

推荐答案

能否请您为需要修改的必需AVD尝试修改AVD配置文件 config.ini .复制现有的AVD,对硬件配置文件进行必要的更改,然后将其用作基础

Could you please try modifying the AVD configuration file config.ini for the required AVD that needs to be modified. Copy an existing AVD, make necessaryy changes to hardware profile and use it as base

参考:

https://developer.android.com/studio/run/managing-avds#copyavd

https://stuff.mit.edu/afs/sipb/project/android/docs/tools/devices/managing-avds-cmdline.html#hardwareopts

https://developer.android.com/studio/run/managing-avds#hardware-profile

这篇关于如何使用硬件配置文件从命令行创建AVD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆