Chinaunix首页 | 论坛 | 博客
  • 博客访问: 464378
  • 博文数量: 153
  • 博客积分: 3010
  • 博客等级: 中校
  • 技术积分: 1724
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-08 11:55
文章分类

全部博文(153)

文章存档

2011年(1)

2010年(55)

2009年(88)

2008年(9)

我的朋友

分类: LINUX

2009-02-11 09:47:14


Just for memo, refer to link: http://code.google.com/android/intro/develop-and-debug.html#developingondevicehardware

Developing on Device Hardware

If you have an Android device, you can develop and debug your Android applications just as usual. Launching your apps on a device works just the same as on the emulator, but there are a few things to do before you can start.

  1. Declare your application as "debuggable" in your Android Manifest.

    In Eclipse, you can do this from the Application tab when viewing the Manifest (on the right side, set Debuggable to true). Otherwise, in the AndroidManifest.xml file, add android:debuggable="true" to the element.

  2. Turn on "USB Debugging" on your device.

    On the T-Mobile G1, go to the home screen, press MENU, select Applications > Development, then enable USB debugging.

  3. Setup your system to detect your device.
    • If you're developing on Windows (32-bit only), you need to install the USB driver for adb:
      1. Download the driver ZIP file () and unzip it.
      2. Connect your Android device via USB. When the Found New Hardware Wizard appears, you'll be asked if you'd like Windows Update to search for software, select No, not this time and click Next.
      3. Select Install from a list or specified location and click Next.
      4. Select Search for the best driver in these locations. Browse and select the unzipped file.
      5. Click Finish. You're all set.
    • If you're developing on Mac OS X, it just works. Skip this step.
    • If you're developing on Ubuntu Linux, you need to add a rules file:
      1. Login as root and create this file: /etc/udev/rules.d/50-android.rules.

        For Gusty/Hardy, edit the file to read:
        SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

        For Dapper, edit the file to read:
        SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"

      2. Now execute:
        chmod a+rx /etc/udev/rules.d/50-android.rules

You can verify that your device is connected by executing adb devices from your SDK tools/ directory. If connected, you'll see the device name listed as a "device."

If using Eclipse, select run or debug as usual. You will be presented with a Device Chooser dialog that lists the available emulator(s) and connected device(s). Select the device to install and run the application there.

If using the (adb), you can issue commands with the -d flag to target your connected device.


阅读(577) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~