创建 Android虚拟设备(AVD)
1、在第一次运行android时,会报一个错误:Failed to find an AVD compatible with target 'Android 1.5'. Launch aborted. 原因是缺少AVD(Android Virtual Device)。
2、Andriod developers网站的Dev Guide上详细介绍了创建一个AVD的方法:
参考[http://developer.android.com/guide/developing/eclipse-adt.html#CreatingAnAvd]
英文全文如下:
Creating an AVD
To avoid some explanation that's beyond the scope of this document, here's the basic procedure to create an AVD:
1. Open a command-line (e.g.,"Command Prompt" application on Windows, or "Terminal" on Mac/Linux) and navigate to your SDK package's tools/ directory.
2. First, you need to select a Deployment Target. To view available targets, execute:
android list targets
This will output a list of available Android targets, such as:
id:1
Name: Android 1.1
Type: platform
API level: 2
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id:2
Name: Android 1.5
Type: platform
API level: 3
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
Find the target that matches the Android platform upon which you'd like
to run your application. Note the integer value of the id — you'll use
this in the next step.
3. Create a new AVD using your selected Deployment Target. Execute:
android create avd --name <your_avd_name> --target <targetID>
4. Next, you'll be asked whether you'd like to create a custom hardware
profile. If you respond "yes," you'll be presented with a series of
prompts to define various aspects of the device hardware (leave entries
blank to use default values, which are shown in brackets). Otherwise,
press return to use all default values ("no" is the default).
全文翻译如下:
创建一个Android虚拟设备
为了避免超出本文档范围,下面是创建一个Android虚拟设备的基本过程:
1.启动一个命令行窗口并导航到SDK的tools子目录。
2. 首先,你需要选择一个部署目标。显示可获得的目标,请执行:
android list targets
控制台将输出当前可用的Android目标列表,例如:
id:1
Name: Android 1.1
Type: platform
API level: 2
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id:2
Name: Android 1.5
Type: platform
API level: 3
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
找到与你的应用程序依赖的Android平台对应的目标。记住对应id的整型值—下一步将会用到它。
3. 创建一个适用于你选择的部署目标的新的AVD.执行以下命令:
android create avd --name <your_avd_name> --target <targetID>
4. 接下来,将询问你是否将要创建一个自定义的硬件设备。如果你选择“yes”,接下来将会出现一系列提示,定义硬件设备的各个方面(使用entries blank的默认值, 默认值是括号中的值)。否则,通过回车选择所有默认值(“no”是默认值)。

浙公网安备 33010602011771号