This question seems to be all over google, but the answers all point to using System Profiler. That's nice, but with System Profiler all you get is something that looks like this:
DasKeyboard:
Product ID: 0x1919
Vendor ID: 0x04d9 (Holtek Semiconductor, Inc.)
Version: 1.06
Speed: Up to 1.5 Mb/sec
Location ID: 0x1d114000 / 11
Current Available (mA): 500
Current Required (mA): 100
USB2.0 Hub:
Product ID: 0x0608
Vendor ID: 0x05e3 (Genesys Logic, Inc.)
Version: 32.98
Speed: Up to 480 Mb/sec
Location ID: 0x1d113000 / 10
Current Available (mA): 500
Current Required (mA): 100
Microsoft Basic Optical Mouse v2.0 :
Product ID: 0x00cb
Vendor ID: 0x045e (Microsoft Corporation)
Version: 1.99
Speed: Up to 1.5 Mb/sec
Manufacturer: Microsoft
Location ID: 0x1d113200 / 12
Current Available (mA): 500
Current Required (mA): 100
That's great if all you want are the contents of a bunch of device descriptors, but lsusb
gives you so much more - information on interfaces and endpoints, interface associations, composite devices... where can you find this information in OS X? There must be a tool that does this?
I got tired of forgetting the system_profiler SPUSBDataType
syntax, so I made an lsusb
alternative. You can find it here , or install it with homebrew:
brew install lsusb
我通常运行此命令列出Mac OS X上的USB设备,以及有关它们的详细信息:
ioreg -p IOUSB -l -w 0
Homebrew users: you can get lsusb
by installing usbutils
formula from my tap:
brew install mikhailai/misc/usbutils
It installs the REAL lsusb
based on Linux sources (version 007).
在mac osx中,您可以使用以下命令:
system_profiler SPUSBDataType
How about ioreg
? The output's much more detailed than the profiler, but it's a bit dense.
Source: https://lists.macosforge.org/pipermail/macports-users/2008-July/011115.html
system_profiler SPUSBDataType
你需要在macos上命令
至少在system_profiler SPUSBDataType
上,当新的USB设备插入时, system_profiler SPUSBDataType
输出不会动态更新,而ioreg -p IOUSB -l -w 0
动态更新。
On Mac OS X, the Xcode developer suite includes the USB Proper.app application. This is found in /Developer/Applications/Utilities/. USB Prober will allow you to examine the device and interface descriptors.
I'll through my hat into this having tried the answers here. The lsusb
script is barely working and the macOS port of usbutils
doesn't capture string descriptors or support --tree
.
It lead me to create cyme , a modern cross-platform USB list tool using system_profiler -json
under the hood. It also uses libusb
for extra data/cross-platform and udev
on Linux. It supports --lsusb
compatible mode, which near matches lsusb
's output for all args. It should scratch the macOS lsusb
itch and more.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.