Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ADB doesn't recognise device anymore

Tags:

linux

android

adb

A whole line of tablets don't show at ADB devices anymore (they worked just fine one week ago). Other Android devices do work (like my Nexus 5 phone). This is first time I face this problem. I've read and tried most solutions I've found at SO and other sites to no avail. Here's the situation:

  • They show in lsusb as Bus 010 Device 004: ID 18d1:dddd Google Inc..
  • Created/edited /etc/udev/rules.d/51-android.rules and added SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666" (and several other attribute combinations here).
  • Restarted udev via sudo service udev restart.
  • Restarted ADB server via adb kill-server; adb start-server`.
  • Tried all USB ports on PC.
  • Tried another USB cable.
  • Restarted PC and tablet.

A strange thing is that even if I empty /etc/udev/rules.d/51-android.rules file and restart the udev daemon, adb still detects my Nexus 5 phone.

Changes I remember I did before this problem started to happen:

  • Started using Android Studio instead of Eclipse (although I'm using the same ADK) and tools)
  • Upgraded Ubuntu to latest version 14.04 (maybe some udev changes/problem here?)

Any further suggestions are welcome, thanks in advance.


EDIT: When running lsusb -v as suggested in the comments, I can see this description:

  bInterfaceClass         8 Mass Storage
  bInterfaceSubClass      6 SCSI
  bInterfaceProtocol     80 Bulk-Only
  iInterface              1 Mass Storage

while the Nexus 5 shows as

  bInterfaceClass       255 Vendor Specific Class
  bInterfaceSubClass    255 Vendor Specific Subclass
  bInterfaceProtocol      0
  iInterface              4 MTP

EDIT: The tablets are working perfectly through ADB in other computers (Windows and Linux). So it must be a problem with my box.


EDIT: As suggested in the comments, I tried ADB in TCP mode and works fine. After running dmesg I can see the system is trying to load the Windows driver for ADB using ndiswrapper

[277701.803751] usb 1-4: reset high-speed USB device number 48 using ehci-pci
[277701.952803] ndiswrapper (load_wrap_driver:103): couldn't load driver android_winusb; check system log for messages from 'loadndisdriver'

This message doesn't show on the other Linux boxes where ADB works fine through USB.

like image 475
m0skit0 Avatar asked Nov 10 '22 00:11

m0skit0


1 Answers

Since the same devices work on other PCs, you can already rule out hardware issues on the tablets' side. Further things to check are:

  • USB permissions on the PC: Though other devices work, you might still have insufficient permissions to access the tablets using adb. The udev rules you've mentioned are vendor-specific, and sometimes also device-specific. The only way to rule permissions out as a problem is to start adb as the root user. adb forks a daemon, so you've got to kill any instances of adb before attempting to do that:
    $ pkill adb
    $ sudo adb devices
    If the device does show up in the list, you've got to adjust the udev rules. Temporarily, you can continue to use adb normally - it will connect to the service that is now running as root and therefore working as expected.
  • Driver issues: In the developer menu on your tablet, you can select "adb over tcp" as an option. Enable it and then connect to it from your PC. If this works, the debug bridge itself is fine and the USB connection must therefore be the source of the issue. We can already rule out a defective cable, because the device does show up in lsusb and other functionality works as expected. Running dmesg should give you the required information to solve your problem, likely it's an interfering device driver. Try unloading it using rmmod/modprobe.
like image 164
Phillip Avatar answered Nov 14 '22 21:11

Phillip