Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

how to create android emulator in command line with options?

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.

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>]:

Are there some tools I can just pass options as parameters, like --hw.mainKeys false ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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/

See official documentation here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...