tags:

views:

532

answers:

4

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 USBlyzer does for Windows but programmatically.

+1  A: 

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.

mouviciel
+1  A: 

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.

guzzibill
Thank you, that is exactly the information I need, except I need to get it programmatically!
Abdullah Jibaly
A shell script would be perfect.
Abdullah Jibaly
The system_profiler command does it from the terminal.
Abdullah Jibaly
A: 

You can use the I/O Kit framework. Look at the examples here and use the complete API reference to get the information you need.

A: 

You can also use a Terminal and execute:

system_profiler SPUSBDataType

It will show all USB device connected with detailed informations

Niko