Thursday, December 30, 2010

adb not detecting adroid device

OS: Ubuntu 10.04 Lucid Lynx
Date: December 30th, 2010

 I'm sure there must be tons of posts on this particular issue, however I had hard time finding solution so here it is.
 I got my android phone and can't be happier well after first few days wanted to tinker with it, so I got an android SDK extracted and ran android from tools directory to pull all required features. Then time to enter few udev rules so the USB device can be detected (consider it as installing drivers in windows system) Developer page explains how-to and provides Vendor-IDs for each device.

for e.g. I've Samsung Epic 4g and command lsusb provides following output

  • lsusb:
  • Bus 002 Device 006: ID 04e8:681c Samsung Electronics Co., Ltd
  • 04e8 is my vendor ID
however even after following all directions for adb devices output is
  • adb devices
  • List of devices attached 
          ???????????? no permissions

 which is not very helpful
so the workaround is starting adb server with super user permissions. as follows:
  • adb kill-server
  • sudo adb start-server
and then 
  • adb devices
  • List of devices attached 
          D70029974153 device
    yey I got it detected and working


    1. Thank you so much for this I tried all combination sudo commands but never thought of starting the server with a sudo... always is the simplest things! lol

    2. thanks..worked perfectly.

    3. I am getting following info when i am running the above mentioned command.

      sudo: /etc/sudoers.d/README is mode 0777, should be 0440
      >>> /etc/sudoers: /etc/sudoers.d/README near line 23 <<<
      sudo: parse error in /etc/sudoers near line 23
      sudo: no valid sudoers sources found, quitting

    4. Here is an alternative to running adb as root...
      Create a file called 51-android.rules in /etc/udev/rules.d with the following contents
      SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"

      Then run the following command to reload the udev rules ...

      udevadm control --reload-rules

      Now plugin your SGS2 mobile phone in to the computer's USB port and run `adb devices`.

    5. Thank you so much! It works fine.