Obtaining a Mac's System Profiler data from shell

拟墨画扇 提交于 2020-01-05 03:58:09

问题


How can I retrieve the information shown in the Mac's System Profiler app programatically? I'm actually interested in the USB section if that matters.


回答1:


Take a look at the system_profiler(8) command.




回答2:


The OSX command line tool "ioreg" might give you want you want.

man ioreg

ioreg displays the I/O Kit registry. It shows the heirarchical registry as an inverted tree.

Also if you can/want to use Cocoa look at IOKit. IOKit is the OSX framework that talks to USB hardware.



来源:https://stackoverflow.com/questions/426801/obtaining-a-macs-system-profiler-data-from-shell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!