“List of devices attached” is empty on Ubuntu 16.0

2019-05-03 22:24发布

I am unable connect my Android to Ubuntu.

On executing command lsusb. It shows attached device.

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04ca:0061 Lite-On Technology Corp. 
Bus 001 Device 002: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 025: ID 2a70:9011  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

And I have created rule using this command.

echo SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", MODE="0666", GROUP="plugdev" | sudo tee /etc/udev/rules.d/51-android-usb.rules

And after running adb devices. It is not showing any attached device.

I have also reinstalled adb tools. Even though it is not working.

标签: android adb
3条回答
神经病院院长
2楼-- · 2019-05-03 22:51

First, try unplug then plug the device. Then check the the message log using dmesg instead lsusb, because it gives you more information about the idVendor and idProduct. Use the following command to show the last 10 message log:

dmesg | tail

Now, you can ge the idVendor and idProduct. It will be something like this:

[24936.555273] usb 1-2: USB disconnect, device number 9
[24939.022181] usb 1-2: new high-speed USB device number 10 using xhci_hcd
[24939.187152] usb 1-2: New USB device found, idVendor=04e8, idProduct=6860
[24939.187154] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[24939.187156] usb 1-2: Product: SAMSUNG_Android
[24939.187157] usb 1-2: Manufacturer: SAMSUNG
[24939.187158] usb 1-2: SerialNumber: 5ae1b464
[24939.188132] cdc_acm 1-2:1.1: ttyACM0: USB ACM device

add the following line to your /etc/udev/rules.d/51-android.rules (Beware, you need to change idVendor, idProduct and username to yours):

SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", ATTR{idProduct}=="9011", MODE="0600", OWNER="username"

You also can use the 51-android.rules file from android-udev-rules.

Here I'm copying the step for Ubuntu from its documentation:

# Clone this repository
git clone git@github.com:M0Rf30/android-udev-rules.git
# Create a sym-link to the rules file
sudo cp android-udev-rules/51-android.rules /etc/udev/rules.d/
# Change file permissions
sudo chmod a+r /etc/udev/rules.d/51-android.rules
# add the adbusers group if it's doesn't already exist
sudo groupadd adbusers
# Add your user to the adbusers group
sudo usermod -a -G adbusers $(whoami)
# Restart UDEV
sudo udevadm control --reload-rules
sudo service udev restart
# Restart the ADB server
adb kill-server
# Replug your Android device and verify that USB debugging is enabled in developer options
adb devices
# You should now see your device
查看更多
萌系小妹纸
3楼-- · 2019-05-03 22:56

You need to enable USB debugging on your phone.

This video demonstrates this from 0:33 to 1:03.

Copying the steps here:

  1. On your android device, go to SettingsSystemAbout phone. Scroll down to Build number and continuously tap on it for a few times until a popup announcing Developer options to have been activated appears.
  2. Go to SettingsDeveloper optionsDebugging and activate USB debugging.

The device should now be listed under $ adb devices once connected.


Tested with Android 5.1 and Ubuntu 17.10.

查看更多
相关推荐>>
4楼-- · 2019-05-03 22:59

I had the same problem with an empty list of adb devices. The only solution that worked for me was to take the first part of the device's ID(vendor id 0e8d):

# lsusb
Bus 001 Device 055: ID 0e8d:201d MediaTek Inc. 

Then edit, or create if it doesn’t exist the file ~/.android/adb_usb.ini and place on a single line the prefix 0x followed by your vendor id:

# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x0e8d

Then restart the adb:

adb kill-server
adb start-server;
adb devices
查看更多
登录 后发表回答