0

I'm trying to be able to use adb with my tablet. The tablet and its file tree gets recognized in the Files directory navigator and I can navigate to /media/me/SP1020.

What I don't understand is why adb can't recognize the device. I ran these instructions from terminal:

adb kill-server
adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
adb devices
    List of devices attached 

And nothing is displayed.

lsusb lists the device ID as:

Bus 001 Device 004: ID 1f3a:1000

so I entered this ID, "0x1f3a" at the top of adb_usb.ini using vim in ~/.android; after this not working, I deleted this file adb_usb.ini and I also tried typing

echo "0x1f3a" > ~/.android/adb_usb.in

This time retaining the file. I have also created a file 51-android.rules in /etc/udev/rules.d with the following content:

SUBSYSTEM=="usb",SYSFS{idVendor}=="1f3a",MODE="0666"

I then rebooted my system and my tablet, and tried

adb kill-server
adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
adb devices
    List of devices attached 

And still nothing is displayed.

Here's also the contents of the usb/004

ls -l /dev/bus/usb/004
total 0
crw-rw-r-- 1 root root 189, 384 Sep 23 09:53 001
Alex P.
  • 30,437
  • 17
  • 118
  • 169
user1790399
  • 220
  • 2
  • 11
  • echo "0x1f3a" > ~/.android/adb_usb.ini;adb kill-server;adb devices – Alex P. Sep 23 '14 at 14:55
  • I had entered the 0x1f3a into the adb_usb.ini using vim (perhaps this was a bit unclear from the question so I updated it), but I just tried it your way to see if anything would be different. I still do not get any output from adb devices under "list of devices attached." – user1790399 Sep 23 '14 at 15:09
  • see if `find -L /sys/bus/usb/devices -maxdepth 2 -path "*/modalias" -printf "%h\t" -exec cat {} \; | awk -F: '/icFFisc42ip0/ {print $1}'` produces any output. if not - your device does not have ADB interface enumerated – Alex P. Sep 23 '14 at 15:20

3 Answers3

1

Here is a bash function I use to detect and register all adb devices in the system:

UpdateAdbUsbIni () {
    INIFILE=${1:-$HOME}/.android/adb_usb.ini
    mkdir -p $(dirname $INIFILE)
    DEVICES=$(find -L /sys/bus/usb/devices -maxdepth 2 -path "*/modalias" -printf "%h\t" -exec cat {} \; | awk -F: '/icFFisc42ip0/ {print $1}')
    echo -e "\nRegistering Vendor IDs for the following ADB devices:"
    for D in $DEVICES
    do
        echo -e "\tDEVPATH=$D Serial=$(cat $D/serial) VendorID=0x$(cat $D/idVendor) ($(cat $D/manufacturer))"
        echo "0x$(cat $D/idVendor)" >> $INIFILE
    done
    VIDS=$(grep ^0x....$ $INIFILE | sort -u)
    echo "$VIDS" > $INIFILE
    return 0
}

This function does not depend on the existing adb configuration. So if it does not list any devices - it means no connected devices have adb interfaces enumerated.

Here is another useful function:

InstallUniversalAndroidUdevRule () {
    RULE='ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:ff420?:*", MODE="0666", GROUP="plugdev", SYMLINK+="android/$env{ID_SERIAL_SHORT}"'
    RULEFILE="/etc/udev/rules.d/${1:-90}-universal-android.rules"
    if [ "0$(id -u)" != "00" ]; then echo "No permission to add the universal Android udev rule!"; return 1; fi
    echo "$RULE" > $RULEFILE
    udevadm control --reload-rules
    udevadm trigger --action=add --subsystem-match=usb
    return 0
}

This function adds the universal android udev rule which would match all android devices regardless of the manufacturer. It does require root privileges to run though.

This question has prompted me to finally finish my The most comprehensive write up on how to properly install adb in a debian-based linux environment

Alex P.
  • 30,437
  • 17
  • 118
  • 169
0

Wow, I'm such an idiot.

I tried the UpdateAdbUsbIni script, got no response, and went to check if anything was wrong with the device. Turns out that under "Settings" -> "{} Developer options", "USB debugging" was unchecked. When I checked this option and reconnected the device sure enough I got:

adb devices
   List of devices attached 
   4d773808680064314c9  device

Thanks for that Alex P!

user1790399
  • 220
  • 2
  • 11
-2

On my system (Ubuntu 12.04) you have to run adb kill-server/adb start-server as root. Try using:
sudo adb kill-server
sudo adb start-server

steven smith
  • 1,519
  • 15
  • 31
  • Um -- why was this downvoted? I have had exactly the problem described and this fixes it. – steven smith Sep 23 '14 at 17:53
  • there is absolutely no reason to run `adb` as `root`. This is worse than trying to cure dandruff with guillotine. – Alex P. Sep 23 '14 at 20:30
  • Maybe -- other than the fact that at least in my case, after running stop/start server and doing adb devices -- I have devices. – steven smith Sep 23 '14 at 20:53
  • Also a quick google gave me http://stackoverflow.com/questions/3127539/ubuntu-android-device-debug/3129903#3129903 where this solution received 31 upvotes, 1 person saying it was a bad solution with 17 upvotes and discussion saying the non-root "fix udev" solution didn't work for them -- as it also didn't work for me. – steven smith Sep 23 '14 at 21:03
  • being "accepted" and "most upvoted" does not make it right. above all the OP did not have the "adb permissions" issue. running adb as root would not help him one bit. – Alex P. Sep 23 '14 at 21:20
  • Please define "adb permissions" issue. And since @user1790399 still hasn't replied, I'm anxious to see what does fix his problem. – steven smith Sep 23 '14 at 21:59
  • 1
    his reply is right there http://stackoverflow.com/a/26002233/1778421 and "adb permissions" is when `adb devices` shows `???????????? no permissions`. And it's the easiest to fix with proper `udev` rule. When you said that `udev` rule did not fix your problem - it only means that you either had a different issue altogether or were doing it wrong. – Alex P. Sep 24 '14 at 02:35