how to collect system info in osx using objective c

前端 未结 5 1098
予麋鹿
予麋鹿 2021-02-01 10:56

Is there any method / API defined to collect system info in osx. I want to write utility which will collect hardware information like CPU,RAM,Network adapter. Any idea ? Thanks

5条回答
  •  醉酒成梦
    2021-02-01 11:15

    The easiest way is to use the output from the system_profiler command. It also has an -xml option to make the output easy to automatically parse.

提交回复
热议问题