引用
android 工具是一个脚本文件,用于创建,管理AVDs (Android Virtual Devices).
AVD 由四部分组成:
1.一个硬件配置:
定义设备硬件.
比如:camera ,键盘, 内存大小等.
2.系统图片:
3.其它:
皮肤,屏幕大小,外表,SD卡
4.专用的存储区:
存储设备用户数据(应用,设置等),模拟SD卡.
创建AVD:
引用
android create avd -n <name> -t <targetID> [-<option> <value>] ...
查看可用目标:
引用
D:\WINDOWS\system32>android list targets
Available Android targets:
id: 1
Name: Android 1.5
Type: Platform
API level: 3
Revision: 1
Skins: QVGA-P, QVGA-L, HVGA-P, HVGA (default), HVGA-L
id: 2
Name: Android 1.6
Type: Platform
API level: 4
Revision: 1
Skins: WVGA800, QVGA, WVGA854, HVGA (default)
id: 3
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 3
Description: Android + Google APIs
Based on Android 1.5 (API level 3)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: QVGA-P, HVGA-L, HVGA (default), QVGA-L, HVGA-P
id: 4
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 1.6 (API level 4)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, HVGA (default), QVGA, WVGA800
选择目标:
比如:选择目标id:2.
引用
android create avd -n my_android1.5 -t 2
更多设置参照ADT插件配置吧.
mksdcard
创建FAT32磁盘镜象,让模拟器模拟SD卡.
用法:
引用
mksdcard [-l label] <size>[K|M] <file>
引用
D:\WINDOWS\system32>mksdcard -l "tl" 1024M c:\sd\sd1
-l:指定卷标签
size:大小
file:要创建的镜象文件
加载SD卡:
引用
emulator -sdcard <file>
引用
D:\WINDOWS\system32>emulator -sdcard c:\sd\sd1
emulator: emulator window was out of view and was recentred
dx
为了在Androd environment中运行,dx 工具把.class 文件生成字节码(.dex).
它也可以dump 这个类为人可读的格式,并运行一个单元测试.
用法:
引用
D:\WINDOWS\system32>dx -help
usage:
dx --dex [--debug] [--verbose] [--positions=<style>] [--no-locals]
[--no-optimize] [--statistics] [--[no-]optimize-list=<file>] [--no-strict]
[--keep-classes] [--output=<file>] [--dump-to=<file>] [--dump-width=<n>]
[--dump-method=<name>
] [--verbose-dump] [--no-files] [--core-library] [<file>.class | <file>.{zip,jar,apk} | <directory>] ...
Convert a set of classfiles into a dex file, optionally embedded in a
jar/zip. Output name must end with one of: .dex .jar .zip .apk. Positions
options: none, important, lines.
dx --annotool --annotation=<class> [--element=<element types>]
[--print=<print types>]
dx --dump [--debug] [--strict] [--bytes] [--basic-blocks | --rop-blocks]
[--width=<n>] [<file>.class | <file>.txt] ...
Dump classfiles in a human-oriented format.
dx --junit [-wait] <TestClass>
Run the indicated unit test.
dx -J<option> ... <arguments, in one of the above forms>
Pass VM-specific options to the virtual machine that runs dx.
dx --version
版本
dx --help
帮助