47

Ubuntu 14.04 doesn't recognize any of my Android devices anymore. (Tried with the Nexus 7 and Galaxy Nexus)

I thought this was an MTP or ADB-problem, but connecting / disconnecting the devices doesn't even change the output of lsusb or dmesg at all.

It's like the devices aren't even plugged-in. However they both charge normally, when I plug them in, so I can't imagine having a cable-problem or a problem with the android devices themselves.

(I've tried it with usb-debugging on and off on both devices - no difference)

RazorHail
  • 821
  • 1
  • 8
  • 11
  • @MichaelMartinSmucker, can you comment to include your Ubuntu version and any other details? – Anwar Oct 29 '16 at 17:42
  • 2
    @Anwar gladly! Using Ubuntu 16.04. I'm trying 2 different Android phones (2014 Moto X and 2015 Moto X), 2 different USB ports, and I've tried 2 different USB cables. Both of the devices have connected in the past, but now it's intermittent at best. Both devices are in USB Debugging mode. – Michael Martin-Smucker Oct 29 '16 at 18:27
  • try this: `abd kill-server` and again `sudo adb devices`. Also do not forget to unlock your device and "Allow" the deivce for USB Debugging. – Techjail Nov 02 '16 at 11:29
  • Drivers should be in your kernel, but it could be that libmtp has been uninstalled? You can check if it's installed with: dpkg -l | grep libmtp – Johan Schuijt Nov 02 '16 at 10:28
  • 1
    Note that data and power don't travel on the same pins on your cable so the fact that they charge doesn't mean there isn't a cable problem. – Elder Geek Nov 03 '16 at 14:16
  • @MichaelMartin-Smucker, any output from `udevadm monitor` when you connect & disconnect the phones? – user.dz Nov 04 '16 at 16:36
  • does this work on another OS? –  Nov 05 '16 at 15:46
  • 1
    Sorry, I was doing a very poor job of monitoring this. Forgot I created the bounty. :P Turns out @Nefta's point #2 (unlock the device, which other people also mentioned) was the real key. I was trying to connect a device with a dead screen, so I didn't notice that it kept locking on me. – Michael Martin-Smucker Nov 05 '16 at 17:31
  • I have the same problem but after upgrading from 14.04 to 21.04 My Samsung is not recognized anymore when connected to usb. – A.W. Jan 10 '22 at 05:46
  • FWIW for me, I got the connection "ding" from the phone but nothing in `sudo dmesg` despite the phone charging normally. I found that I had to use Android developer options to reset the usb connection mode to allow file transfers (I must have fat-fingered that at one point). It still didn't work, I had to connect to a different port as the front USB ports were flakey. – pbhj Nov 07 '22 at 00:02

7 Answers7

26

I have problems with my Ubuntu GNOME 14.04 installation recognizing my Nexus 7 at times, too. This is what works for me:

  1. Make sure the cable can transfer information, that it's not just a power cable.
  2. Make sure you have USB debugging enabled.
  3. Unlock your device.
  4. Connect your device to your computer.
  5. Your device should display a pop-up, asking if you want to accept a connection to your computer. (If you had this pop-up before, you might have ticked the "always accept a connection from this device" checkbox.)
  6. Normally, your device should now pop up in your favorite file manager. If it doesn't, check if ADB finds your device. In a terminal, type adb devices (you might need to be root).
  7. If ADB lists your device, go to Settings > Storage and select the options button in the upper right corner:

Upper right hand corner options

  1. Select the file sharing option you want:

File sharing options

Stefan van den Akker
  • 1,235
  • 2
  • 12
  • 22
25

The problem was ultimately the cable.

Some USB cables are just for charging. Other cables also support data. I tried 3-4 different cables, until one of them ultimately worked.

That was the reason, why connecting the phone didn't even register with dmesg at all.

RazorHail
  • 821
  • 1
  • 8
  • 11
  • I had the same issue, and I had forgotten the difference between cables. Usually the cable that comes with the phone works (and has the usb logo in the cable too). – Andrés Parada Sep 18 '18 at 17:28
  • The is no way to tell what is what. You are just messing with our heads – abc Dec 10 '21 at 11:57
6

To set up device detection on Ubuntu Linux:

Log in as root and create this file: /etc/udev/rules.d/51-android.rules.

Use this format to add each vendor to the file:

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"

In this example, the vendor ID is for HTC. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node.

Now execute:

 sudo chmod a+r /etc/udev/rules.d/51-android.rules

From developer.android.com/studio/run/device.html

Organic Marble
  • 22,803
  • 12
  • 65
  • 118
  • Please cite https://developer.android.com/studio/run/device.html. This seems like an answer for the case where adb does not list your device, but still did not work for me. – Robin like the bird Jan 18 '17 at 19:53
5

As Organic Marble correctly said, you need to create a file /etc/udev/rules.d/51-android.rules with one or more of the following lines:

SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev" #Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev" #ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666", GROUP="plugdev" #Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666", GROUP="plugdev" #Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev" #Fujitsu
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev" #Fujitsu Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="091e", MODE="0666", GROUP="plugdev" #Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" #Google
SUBSYSTEM=="usb", ATTR{idVendor}=="201E", MODE="0666", GROUP="plugdev" #Haier
SUBSYSTEM=="usb", ATTR{idVendor}=="109b", MODE="0666", GROUP="plugdev" #Hisense
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev" #HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666", GROUP="plugdev" #Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666", GROUP="plugdev" #K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666", GROUP="plugdev" #KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666", GROUP="plugdev" #Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", MODE="0666", GROUP="plugdev" #Lenovo
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev" #LG
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev" #Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", MODE="0666", GROUP="plugdev" #MTK
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666", GROUP="plugdev" #NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666", GROUP="plugdev" #Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666", GROUP="plugdev" #Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666", GROUP="plugdev" #OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="10a9", MODE="0666", GROUP="plugdev" #Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="1d4d", MODE="0666", GROUP="plugdev" #Pegatron
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666", GROUP="plugdev" #Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666", GROUP="plugdev" #PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev" #Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666", GROUP="plugdev" #SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev" #Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666", GROUP="plugdev" #Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="054c", MODE="0666", GROUP="plugdev" #Sony
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666", GROUP="plugdev" #Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="2340", MODE="0666", GROUP="plugdev" #Teleepoch
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666", GROUP="plugdev" #Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev" #ZTE

Source

Willi Mentzel
  • 638
  • 1
  • 7
  • 20
5

if dmesg doesn't report any change, it's definitively a cable problem or in the worst case a problem with the microUSB port of the Android devices

mattia.b89
  • 712
  • 5
  • 12
  • 2
    I can confirm that this happens with a working cable as well. If the Android device does not accept an USB connection, not even a golden cable will help :) – BurninLeo Jan 09 '17 at 19:16
  • Mine was apparently a problem with the actual USB ports, they connected sufficiently to charge but not to give a consistent connection for file transfer. Probably because they're top-mounted and got dusty. – pbhj Nov 07 '22 at 00:04
2

To use the android phones in Ubuntu, developer mode must be enabled.

1.First you must go to setting on your android and scroll down to "About phone." Tap it.

2.Scroll down to the bottom again, where you see "Build number." (Your build number may vary from ours here.)

3.Tap it seven (7) times.

4.After that a new item in the setting appear which is ({}developer options)tap it .... Under debugging you see USB debugging check it now ubuntu 14.04 should see your device enjoy....

anand mbs
  • 431
  • 1
  • 4
  • 17
0

I thought I had a similar issue, my android phone was showing a message after I connected with usb, that the computer can't access the data on the device, however I noticed that my file manager showed my android phone unmounted, so when I pressed on it, the phone displayed a message asking me if I want to allow accessing data, and after consent I could access the phone data.

P.S: I'm on Pop!_OS based on Ubuntu 19.10.

Baha
  • 241
  • 3
  • 7