android
android is an important development tool that lets you:
Create, delete, and view Android Virtual Devices (AVDs). See Managing AVDs from the Command Line.
Create and update Android projects. See Managing Projects from the Command Line.
Update your Android SDK with new platforms, add-ons, and documentation. See 扫描SDK.
If you are using Eclipse, the android tool’s features are integrated into ADT, so you should not need to use this tool directly.
Note: The documentation of options below is not exhaustive and may be out of date. For the most current list of options, execute android --help.
Syntax
android [global options] action [action options]
Global Options
-s
Silent mode: only errors are printed out
-h
Usage help
-v
Verbose mode: errors, warnings and informational messages are printed.
AVD actions and options
Action Option Description Comments
avd None Launch the AVD Manager
sdk None Launch the Android SDK Manager
create avd -n The name for the AVD. Required
-t Target ID of the system image to use with the new AVD. To obtain a list of available targets, use android list targets Required
-c
-f Force creation of the AVD
-p
-s |- The skin to use for this AVD, identified by name or dimensions. The android tool scans for a matching skin by name or dimension in the skins/ directory of the target referenced in the -t argument. For example, -s HVGA-L
delete avd -n The name of the AVD to delete Required
move avd -n The name of the AVD to move Required
-p
-r New name of the AVD if you want to rename it
update avd -n The name of the AVD to move Required
Project actions and options
Action Option Description Comments
create project -n The name for the project Required
-t Target ID of the system image to use with the new AVD. To obtain a list of available targets, use android list targets Required
-k
-a Name for the default Activity class Required
-p
update project -n The name of the project to update
-p
-l Location path of an Android Library to add, relative to the main project
-s Update any projects in subfolders such as test projects
-t Target id to set for the project
create-test-project -n The name of the project
-p
-m The name of the project Required
update-test-project -p
-m The main class of the project to test Required
create-lib-project -k (Required) Package name of the library project Required
-p
-t Target ID of the library project Required
-n The name of the project Required
update-lib-project -p
-l Location path of an Android Library to add, relative to the main project
-t Target ID of the library project
Update actions
update adb
Updates adb to support the USB devices declared in the SDK add-ons.
update sdk
Updates the SDK by suggesting new platforms to install if available.