使用命令行创建Android模拟器

使用命令行创建Android模拟器:
Android的命令工具在其安装文件目录下面的Android\sdk\tools下面。
1.列出target值.

android list targets;----列出本地上可以建立的android的各个版本。


id --23(或者android-11)  --Android3.0 --API Level11;
id --24(或者Google Inc.:Google APIs:11)  --Google APIs --API Level11;
id --25(或者Google Inc.:Google APIs:11)   --Google APIs --API Level11;


id --26(或者android-12)  --Android3.1 --API Level12;
id --27 (或者Google Inc.:Google APIs:12)  --Google APIs --API Level12;


id --28(或者android-13)  --Android3.2 --API Level13;
id --29(或者Google Inc.:Google APIs:13)   --Google APIs --API Level13;
id --30(或者Google Inc.:Google APIs:13)   --Google APIs --API Level13;
id --31(或者Google Inc.:Google  TV Android :13)   --Google APIs --API Level13;
id --32(或者Google Inc.:Google  TV Android :13)  --Google APIs --API Level13;


id --33(或者android-14)  --Android4.0 --API Level14;
id --34(或者Google Inc.:Google APIs:14)  --Google APIs --API Level14;
id --35(或者Google Inc.:Google APIs:14)  --Google APIs --API Level14;


id --36(或者android-15)  --Android4.0.3 --API Level15;
id --37(或者Google Inc.:Google APIs:15)  --Google APIs --API Level15;
id --38(或者Google Inc.:Google APIs:15)  --Google APIs --API Level15;


id --39(或者android-16)  --Android4.1.2 --API Level16;
id --40(或者Google Inc.:Google APIs:16)  --Google APIs --API Level16;
id --41(或者Google Inc.:Google APIs:16)  --Google APIs --API Level16;


id --42(或者android-17)  --Android4.2.2 --API Level17;
id --43(或者Google Inc.:Google APIs:17)  --Google APIs --API Level17;
id --44(或者Google Inc.:Google APIs:17)  --Google APIs --API Level17;




2.创建一个新的AVD.(android create avd -h -------列出命令的帮助信息)

android空格create空格avd空格-n空格myavd空格-t空格23空格-c空格500M空格 -p 空格c:\AVD空格 -s空格600x800


(完整的例子:android create avd -n testavd  -t 42 -c 70M -p c:\AVD -s 600x700 -b armeabi-v7a)
参数详细:
-t  --target 新的AVD的Target ID(必须);
-c --sdcard 指向一个共享的SD存储卡的路径或者是为新的AVD定制的新的SD存储卡的容量大小.如:-t 50M.("M"必须大写)
-p --path 新AVD将被创建的位置路径.
-n  --name新AVD的名字(必须)
-f   --force 强制创建(覆盖已存在的AVD)
-s  --skin 新AVD的皮肤.
-b --abi :The ABI to use for the AVD.The default is to auto-select the ABI if the platform has only one ABI for its system images.例如:android-17里面的abi有armeabi-v7a,和mips,还有x86,共三个.此时就需要用这个参数指定abi.如果只有一个abi,则不需要指定这个参数。
3.运行新创建的AVD.
emulator -avd  testavd.


运行期间不能关闭命令行,关闭命令行时模拟器也会关闭。
创建好模拟器后,在Eclipse里面的Android Virtual Device Manager里面刷新一下就可以看到创建的模拟器了。但是使用以上命令创建的模拟器没有模拟器右侧的导航键。原因还不清楚。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值