how to create android emulator in command line with options?(如何在命令行中使用选项创建 android 模拟器?)
问题描述
我想在命令行中创建带有一些选项的模拟器,例如 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 模拟器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在命令行中使用选项创建 android 模拟器?


基础教程推荐
- iOS4 创建后台定时器 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01