I've written a very short program to collect some log files spit out by a 3rd party application. It zips up the files and emails them to me.
I'd also like to collect some information about the machine, and especially its graphics capabilities. Basically I'd like two pages from System Report, Hardware and Graphics/Displays. Gestalt is gone, so I'm looking for other solutions.
I found a solution here on SO to get the model of the machine using sysctlbyname, but it seems the values here are quite limited.
So, does anyone have a simple way to get GPU information?
Following on Mark's answer above, here's how to do it in (Swift) code. First, I used this solution to run a shell command:
Then after a bit of playing around in system_profiler, I found I was interested in two keys,
SPHardwareDataType
andSPDisplaysDataType
. That left me wondering where system_profiler is located, butwhich system_profiler
solved that. So I finally got what I needed thus:The results are a formatted string that is pretty much good-to-go as it is.