问题描述
我想在命令行中创建带有一些选项的模拟器,例如 hw.mainKeys = false
.我需要它是一个 shell 脚本,以便可以在自动化测试中运行,但是 here 我找不到设置这些值的地方.
I want to create emulator in command line with some options, like hw.mainKeys = false
.
I need it to be an shell script so can run on automation test,however here I could not find a place to set those values.
android create avd
没有指定这些选项的地方.
do not have a place to specify those options.
另一种方法是创建一个平台"类型的 avd,但是,shell 是一个交互式 shell,对人类来说很好,但对脚本来说很难
One alternative is create a 'platform' type avd, however, the shell is a interactive shell that is great for human but hard for script
Android 4.1 is a basic Android platform.
Do you wish to create a custom hardware profile [no]yes
Name of the AVD being run:
avd.name [<build>]:
是否有一些工具我可以将选项作为参数传递,例如 --hw.mainKeys false
?
Are there some tools I can just pass options as parameters, like --hw.mainKeys false
?
推荐答案
您可以创建带有所需参数的文本文件 config.ini
You can create text file config.ini with desired parameters
hw.lcd.density=252
sdcard.size=32M
skin.name=NEXUS-ONE
skin.path=platforms/android-10/skins/NEXUS-ONE
hw.cpu.arch=arm
hw.keyboard.lid=no
abi.type=armeabi
hw.keyboard=no
vm.heapSize=24
hw.ramSize=256
image.sysdir.1=platforms/android-10/images/
查看官方文档这里
这篇关于如何在命令行中使用选项创建 android 模拟器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!