谷歌上原文是:
Create a new AVD using your selected Deployment Target. Execute:
android create avd --name <your_avd_name> --target <targendroid-sdk-windows-1.5_r1\tools>android list
- update avd : Updates an Android Virtual Device to match the folders of a ne
w SDK.
- create project: Creates a new Android Project.
- update project: Updates an Android Project (must have an AndroidManifest.xml).
这样应该就解决eclipse编译工程时会出错(Failed to find a AVD compatible with target 'Android 1.5'. Launch aborted.)问题啦。不知道上面我说的是否有错,不过大家可以借鉴一下。
有关详细的android.bat参数解释如下:
Moves or renames an Android Virtual Device.
Options:
-p --path New location path of the directory where to move the AVD
-n --name Name of the AVD to move or rename [required]
[2009-04-29 15:06:25 - HelloWorld] Performing com.yuankai.android.study.HelloAndroid activity launch
[2009-04-29 15:06:25 - HelloWorld] Failed to find an AVD compatible with target 'Android 1.5'. Launch aborted.
Type: Add-On
Vendor: Google Inc.
Description: Android + Google APIs
Based on Android 1.5 (API level 3)
Libraries:
* com.google.android.maps (maps.jar)
Action "list ":
Lists existing targets or virtual devices.
Options:
No options
Action "list avd":
Lists existing Android Virtual Devices.
Options:
Options:
-t --target Target id to set for the project [required]
-p --path Location path of the project [required]
-n --name Project name
[2009-04-29 15:06:25 - HelloWorld] ------------------------------
[2009-04-29 15:06:25 - HelloWorld] Android Launch!
[2009-04-29 15:06:25 - HelloWorld] adb is running normally.
Available Android targets:
id: 1
Name: Android 1.1
Type: Platform
API level: 2
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
Action "create project":
Creates a new Android Project.
Options:
-k --package Package name [required]
-n --name Project name
-a --activity Activity name [required]
网上找了老久,原因是没有创建Android Virtual Device,解决方法是在DOS界面下运行D:\Android SDK\android-sdk-windows-1.5_r1\tools 目录[注:Android SDK安装目录]中android .bat工具,指令是:android create avd --name android15r1 --target 2 (其中“android15r1”自己指定一个别的名字也可以),
Usage:
android [global options] action [action options]
Global options:
-h --help This help.
-s --silent Silent mode: only errors are printed out.
Action "update avd":
Updates an Android Virtual Device to match the folders of a new SDK.
Options:
-n --name Name of the AVD to update [required]
D:\Android SDK\android-sdk-windows-1.5_r1\tools>
这样就创建了一个自己定义的avd(Android Virtual Device),然后在之后就只要在Eclipse的Run Configurations里面指定一个AVD即在Target下选中我们自己定义的这个AVD即android15r1 就可以运行了.
-t --target Target id of the new AVD [required]
-c --sdcard Path to a shared SD card image, or size of a new sdcard for the
new AVD
-p --path Location path of the directory where the new AVD will be created
id: 2
Name: Android 1.5
Type: Platform
API level: 3
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id: 3
Name: Google APIs
No options
Action "list target":
Lists existing targets.
Options:
No options
Action "create avd":
Creates a new Android Virtual Device.
Options:
-n --name Name of the new AVD [required]
-f --force Force creation (override an existing AVD)
-s --skin Skin of the new AVD
Action "move avd":
- list : Lists existing targets or virtual devices.
- list avd : Lists existing Android Virtual Devices.
- list target : Lists existing targets.
API for Google Maps
Skins: QVGA-P, HVGA-L, HVGA (default), QVGA-L, HVGA-P
Available Android Virtual Devices:
D:\Android SDK\android-sdk-windows-1.5_r1\tools>android create avd --name a
-t --target Target id of the new project [required]
-p --path Location path of new project [required]
Action "update project":
Updates an Android Project (must have an AndroidManifest.xml).
id15r1 --target 2
Android 1.5 is a basic Android platform.
Do you wish to create a custom hardware profile [no]yes
......
.......
Created AVD 'android15r1' based on Android 1.5
-r --rename New name of the AVD to rename