简体   繁体   English

设置Android AVD命令行硬件配置文件

[英]Setting Android AVD Command Line Hardware Profile

When creating a new Android AVD through command line through the following command: 通过命令行通过以下命令创建新的Android AVD时:

android create avd -n <name>

You're met with the following output: 您遇到以下输出:

Do you wish to create a custom hardware profile [no]

I've been tasked with created a fully-automated script that will create a new AVD and run some tests (using Robotium). 我的任务是创建一个全自动脚本,创建一个新的AVD并运行一些测试(使用Robotium)。 So far, I've just been using simple batch file commands to achieve this, however, I can't seem to find a way to prevent the above message from appearing and requiring user input. 到目前为止,我刚刚使用简单的批处理文件命令来实现这一点,但是,我似乎无法找到一种方法来阻止上述消息出现并要求用户输入。 Is there any way I can either set the hardware profile prior to this message appearing? 有没有什么办法可以在出现此消息之前设置硬件配置文件?

Since the default hardware profile is actually preferred in my case, simply hitting 'Enter' when this message appears (in some automated way) would work fine as well, however I am not aware of a way to do this through scripting. 由于在我的情况下,默认的硬件配置文件实际上是首选的,只要在此消息出现时(以某种自动方式)点击“Enter”也可以正常工作,但是我不知道通过脚本执行此操作的方法。

I am fairly new to both aspects of this question, both Android and scripting, so any help is much appreciated! 我对这个问题的两个方面都很新,包括Android和脚本,所以任何帮助都非常感谢!

尝试

echo no | android create avd -n <name>

To avoid "Do you wish to create custom hardware profile" 要避免“您是否希望创建自定义硬件配置文件”

Type in below command : 输入以下命令

echo. 回声。 | | android create avd -f -n Emulator_01 -t 3 -b default/x86 --skin WVGA800 | android create avd -f -n Emulator_01 -t 3 -b default / x86 --skin WVGA800 | echo. 回声。

Emulator will be created under avd manager..!! 仿真器将在avd经理下创建.. !!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM