If you own an Android smartphone and want to debug your application on your smartphone instead of emulator, you need to declare your application debuggable and setup your device.
To declare your application debuggable, add android:debuggable="true" to element in your application's AndroidManifest.xml
To setup your device, connect it to your computer with a usb cable and run following command:
Vendor IDs:
To declare your application debuggable, add android:debuggable="true" to
To setup your device, connect it to your computer with a usb cable and run following command:
adnan@adnan-laptop:~$ adb devices List of devices attached emulator-5554 device ???????????? no permissionsif the output contains a line with many question marks (?), as in the above example, then Ubuntu was not able to identify your device. In this case create the file /etc/udev/rules.d/51-android.rules and add following line to it:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Here the 0bb4 is the vendor id for HTC (Check the list of vendor ids at the end of this post for vendor id of your device) Now unplug and replug the usb cable connecting your device and again run "adb device":
adnan@adnan-laptop:rules.d$ adb devices List of devices attached emulator-5554 device SH1A6TR23522 deviceYour device is ready now and can be used for debugging an application but before trying to install and debug your application on this device, make sure that you have selected the following options on your device:
Settings->Applications->Unknown sourcesNow when your run your app from Eclipse, you will be presented with a dialog of available emulators and devices. To run your app on device instead of emulator select the device from this dialog and your app will be installed and run on the device.
Settings->Applications->Development->USB debugging
Vendor IDs:
Company | USB Vendor ID |
---|---|
Acer | 0502 |
ASUS | 0B05 |
Dell | 413C |
Foxconn | 0489 |
Garmin-Asus | 091E |
18D1 | |
Hisense | 109B |
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 |