Is there an equivalent of lsusb for OS X

2019-03-07 23:03发布

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?

9条回答
贪生不怕死
2楼-- · 2019-03-07 23:21

If you are a user of MacPorts, you may simply install usbutils

sudo port install usbutils

If you are not, this might be a good opportunity to install it, it has ports for several other useful linux tools.

查看更多
该账号已被封号
3楼-- · 2019-03-07 23:22

I typically run this command to list USB devices on Mac OS X, along with details about them:

ioreg -p IOUSB -l -w 0

The documentation of ioreg is here:

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man8/ioreg.8.html

查看更多
太酷不给撩
4楼-- · 2019-03-07 23:27

At least on 10.10.5, system_profiler SPUSBDataType output is NOT dynamically updated when a new USB device gets plugged in, while ioreg -p IOUSB -l -w 0 does.

查看更多
放荡不羁爱自由
5楼-- · 2019-03-07 23:31

In mac osx , you can use the following command:

system_profiler SPUSBDataType
查看更多
The star\"
6楼-- · 2019-03-07 23:39

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.

查看更多
我欲成王,谁敢阻挡
7楼-- · 2019-03-07 23:42

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
查看更多
登录 后发表回答