page.title=Using Hardware Devices @jd:body

In this document

  1. Setting up a Device for Development
    1. USB Vendor IDs

See also

  1. Google USB Driver
  2. OEM USB Drivers

When building a mobile application, it's important that you always test your application on a real device before releasing it to users. This page describes how to set up your development environment and Android-powered device for testing and debugging on the device.

You can use any Android-powered device as an environment for running, debugging, and testing your applications. The tools included in the SDK make it easy to install and run your application on the device each time you compile. You can install your application on the device directly from Eclipse or from the command line with ADB. If you don't yet have a device, check with the service providers in your area to determine which Android-powered devices are available.

If you want a SIM-unlocked phone, then you might consider the Google Nexus S. To find a place to purchase the Nexus S and other Android-powered devices, visit google.com/phone.

Note: When developing on a device, keep in mind that you should still use the Android emulator to test your application on configurations that are not equivalent to those of your real device. Although the emulator does not allow you to test every device feature (such as the accelerometer), it does allow you to verify that your application functions properly on different versions of the Android platform, in different screen sizes and orientations, and more.

Setting up a Device for Development

With an Android-powered device, you can develop and debug your Android applications just as you would on the emulator. Before you can start, there are just a few things to do:

  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 <application> element.

  2. Set up your device to allow installation of non-Market applications.

    On the device, go to Settings > Applications and enable Unknown sources (on an Android 4.0 device, the setting is located in Settings > Security).

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

    On the device, go to Settings > Applications > Development and enable USB debugging (on an Android 4.0 device, the setting is located in Settings > Developer options).

  4. Set up your system to detect your device.

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

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

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

USB Vendor IDs

This table provides a reference to the vendor IDs needed in order to add USB device support on Linux. The USB Vendor ID is the value given to the ATTR{idVendor} property in the rules file, as described above.

CompanyUSB Vendor ID
Acer 0502
ASUS 0B05
Dell 413C
Foxconn 0489
Garmin-Asus 091E
Google 18D1
HTC 0BB4
Huawei 12D1
K-Touch 24E3
KT Tech 2116
Kyocera 0482
Lenevo 17EF
LG 1004
Motorola 22B8
NEC 0409
Nook 2080
Nvidia 0955
OTGV 2257
Pantech 10A9
Pegatron 1D4D
Philips 0471
PMC-Sierra 04DA
Qualcomm 05C6
SK Telesys 1F53
Samsung 04E8
Sharp 04DD
Sony Ericsson 0FCE
Toshiba 0930
ZTE 19D2