Friday, July 27, 2012

Android Device Debugging Problem :: Device unknown in Eclipse

Android emulators are great to test the apps. However, the apps are run in real devices. The test should be performed in real device before releasing it.

If you are using Eclipse IDE, and have problem debugging (running) the apps directly in Android Phones with the device unknown ( ???? ) problem, then follow the below process to solve the problem.

Note :: I'm assuming you are running eclipse in Linux Ubuntu distro.

1. Create a file 51-android.rules in /etc/udev/rules.d/ directory. (If this file is not existed.)
       sudo vim /etc/udev/rules.d/51-android.rules


2. Insert the below line in this file.
      SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
      
3. Then execute
      chmod a+r /etc/udev/rules.d/51-android.rules


4. You may require to restart the eclipse (if still problem persists). Then you will have your real device ready to debug from eclipse. 


At step 2. Please note ATTR{idVendor}=="04e8".
idVendor value should be the USB Vendor ID of the Android Phone you are using to debug the apps.
In my case, I was using Samsung S II and it's USB vendor id is "04e8". You can accordingly edit the usb vendor id appropriate for your phone.

For the complete list of USB vendor ID's of Company, you can click the following link.

http://developer.android.com/tools/device.html#setting-up

Thank you.