在Ubuntu 16.04上,使用“ adb devices”的“已连接设备列表”为空。 [英] “List of devices attached” is empty on Ubuntu 16.04 using "adb devices"

查看:802
本文介绍了在Ubuntu 16.04上,使用“ adb devices”的“已连接设备列表”为空。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将Android连接到Ubuntu。

I am unable connect my Android to Ubuntu.

在执行命令 lsusb 时。显示连接的设备。

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

adb设备。它没有显示任何连接的设备。

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

我还重新安装了adb工具。即使它不起作用。

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

推荐答案

首先,尝试拔出电源,然后插入设备。然后使用dmesg而不是lsusb检查消息日志,因为它为您提供了有关idVendor和idProduct的更多信息。使用以下命令显示最后10条消息日志:

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

现在,您可以创建idVendor和idProduct了。会是这样的:

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

将以下行添加到您的 /etc/udev/rules.d/51-android.rules (请注意,您需要更改 idVendor idProduct 用户名到您的用户名):

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"

您还可以使用 51-an来自 android-udev-rules 的droid.rules 文件。

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

在这里,我正在复制针对Ubuntu的步骤从其文档中获取:

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

这篇关于在Ubuntu 16.04上,使用“ adb devices”的“已连接设备列表”为空。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆