how to collect system info in osx using objective c

前端 未结 5 1101
予麋鹿
予麋鹿 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:07

    The underlying API that I believe System Profiler uses (for at least some of the information it gathers), and that you should use if you want very specific information, is sysctl. It lets you query for individual attributes of the system, including number of CPUs, CPU speed, available RAM, etc.

提交回复
热议问题