创建 Android虚拟设备(AVD)

来源:互联网 发布:小米平板2windows版本 编辑:程序博客网 时间:2024/05/16 08:29

Failed to find an AVD compatible with target 'Android 1.5'. Launch aborted.
初次运行Android应用程序,在控制台一般都会出现上面所示的提示信息,失败的原因是缺少AVD(Android Virtual Device)。
Andriod developers网站的Dev Guide上详细介绍了创建一个AVD的方法:
参考[http://developer.android.com/guide/developing/eclipse-adt.html#CreatingAnAvd]

Creating an AVD
创建一个Android虚拟设备

To avoid some explanation that's beyond the scope of this document, here's the basic procedure to create an AVD:
为了避免超出本文档范围,下面是创建一个Android虚拟设备的基本过程:


   1. Open a command-line (e.g.,"Command Prompt" application onWindows, or "Terminal" on Mac/Linux) and navigate to your SDK package'stools/ directory.
   1.启动一个命令行窗口并导航到SDK的tools子目录。

   2. First, you need to select a Deployment Target. To view available targets, execute:
   2. 首先,你需要选择一个部署目标。显示可获得的目标,请执行:

      android list targets

      This will output a list of available Android targets, such as:
      控制台将输出当前可用的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

      Find the target that matches the Android platform upon whichyou'd like to run your application. Note the integer value of the id —you'll use this in the next step.
      找到与你的应用程序依赖的Android平台对应的目标。记住对应id的整型值—下一步将会用到它。
   3. Create a new AVD using your selected Deployment Target. Execute:
   3. 创建一个适用于你选择的部署目标的新的AVD.执行以下命令:

      android create avd --name <your_avd_name> --target <targetID>

   4. Next, you'll be asked whether you'd like to create a customhardware profile. If you respond "yes," you'll be presented with aseries of prompts to define various aspects of the device hardware(leave entries blank to use default values, which are shown inbrackets). Otherwise, press return to use all default values ("no" isthe default).
   4. 接下来,将询问你是否将要创建一个自定义的硬件设备。如果你选择“yes”,接下来将会出现一系列提示,定义硬件设备的各个方面(使用entries blank的默认值, 默认值是括号中的值)。否则,通过回车选择所有默认值(“no”是默认值)。

原创粉丝点击