如何在命令行中使用选项创建android模拟器? [英] how to create android emulator in command line with options?

查看:276
本文介绍了如何在命令行中使用选项创建android模拟器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在命令行中使用一些选项创建模拟器,例如hw.mainKeys = false. 我需要将其作为shell脚本,以便可以在自动化测试上运行,但是在这里我找不到设置这些值的地方.

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,但是该外壳是一个交互式的外壳,对人类非常有用,但对脚本却很困难

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模拟器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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