macos 在 Mac OS 上枚举 USB 驱动器和 USB 层次结构

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/422199/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:00:28  来源:igfitidea点击:

Enumerating USB drives and usb hierarchy on Mac OS

macosusb

提问by Abdullah Jibaly

What is the best way to discover what USB drives are connected, where they are mounted, and their unique details like Serial number, PID and which USB Hub port they are connected to? Something similar to what USBlyzerdoes for Windows but programmatically.

发现连接了哪些 USB 驱动器、它们安装在哪里以及它们的独特详细信息(如序列号、PID 和它们连接到哪个 USB 集线器端口)的最佳方法是什么?类似于USBlyzer为 Windows所做的事情,但以编程方式。

回答by Niko

You can use Terminal and execute:

您可以使用终端并执行:

system_profiler SPUSBDataType

It will show all connected USB devices, with detailed information.

它将显示所有连接的 USB 设备,以及详细信息。

回答by guzzibill

The Finder has an "about this mac" option under the Apple at the upper left. Ask for more info and follow the devices===> USB tree to find your answers. In a shell or another executing module, I have no idea how to retrieve this info.

Finder 在左上角的 Apple 下方有一个“关于本机”选项。询问更多信息并按照设备 ===> USB 树找到您的答案。在 shell 或其他执行模块中,我不知道如何检索此信息。

回答by Adam

USB Prober is the most useful tool. It can be found at /Developer/Applications/Utilities/USB Prober.

USB Prober 是最有用的工具。它可以在 /Developer/Applications/Utilities/USB Prober 中找到。

回答by mouviciel

I'm not an expert of I/O on Mac OS X, but I've heard of I/O Kit, which may be a good starting point.

我不是 Mac OS X 上的 I/O 专家,但我听说过I/O Kit,这可能是一个很好的起点。