2013-03-01 90 views
9
adb devices -l 
devices [-l]     - list all connected devices 
           ('-l' will also list device qualifiers) 

当我执行它我越来越像什么是adb设备-l列表?

[email protected]:~$ adb devices -l 
List of devices attached 
Medfield14ABxxxx  device usb:2-1.5 
Ztedfield14Axxxx  device usb:2-1.6 
emulator-5554   device 
015d2994ec2xxx   device usb:2-1.5 product:nakasi model:Nexus_7 device:grouper 


Medfield14ABA072  device usb:1-1.1 (changing to different port) 

当我改变至不同的端口其显示总线数为1和2显示在lsusb命令

这是什么设备USB: 2- 1.51.61.1

so -l会做什么,设备限定符的确切含义是什么?

我试过lsusb,但信息与adb device -l不同。

[email protected]:~$ lsusb 
Bus 002 Device 008: ID 18d1:4e42 Google Inc. 
Bus 002 Device 005: ID 17ef:7470 Lenovo 
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
Bus 001 Device 003: ID 046d:c03d Logitech, Inc. M-BT96a Pilot Optical Mouse 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 

回答

5

这是USB子系统中设备的路径。例如2-1.5表示控制器2,端口1,端口5.在两个端口之间必须有一个集线器。这似乎与您的lsusb输出匹配,这表明Bus 002 Device 001是一个集线器。

为了找出这个问题,我找了一个adb的源代码,发现它被称为devpath。你可以在usb_linux.c中看到它是如何发现的。总之,当找到一个设备时,代码解析了符号链接/sys/dev/char/<major>:<minor>,并将最后一个路径组件作为devpath。如果你运行:

$ ls -l /sys/dev/char |grep usb 

可以看到链接指向/sys/devices/platform/...,你应该看到一些这些路径的结束相匹配的设备组件。最后,我发现了Alan Stern在this posting中对这些路径的含义的描述。

+0

好东西。最后一个问题:你如何将这个问题与'lsusb'列出的设备联系起来?例如,'lsusb'列出了“Bus 002 Device 052”和'fastboot devices -l'列出了“usb:2-1.7”,我该如何连接这些点? – 2013-06-19 01:12:38

2

自动挂载很多设备时遇到了同样的问题。多挖掘后,我发现如何找到

adb devices -l 
List of devices attached 
XXXXXXXX  device usb:9-1.4 product:XXXXXXXXXXX 
............. 
XXXXXXXX  device usb:3-1 product:XXXXXXXXXXX 

lsusb 
Bus 009 Device 005: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy (MTP) 
............. 
Bus 003 Device 003: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy (MTP) 

我们MTP装置可以使用可以看出之间的连接:

ls /dev | grep libmtp- 
libmtp-3-1 
............. 
libmtp-9-1.4 
在公共汽车上

他们:

ls -l /dev/libmtp-9-1.4 
lrwxrwxrwx 1 root root /dev/libmtp-9-1.4 -> bus/usb/009/005 

ls -l /dev/libmtp-3-1 
lrwxrwxrwx 1 root root /dev/libmtp-3-1 -> bus/usb/003/003