retreive the model identifier: MacBookPro4,1

Hi, I can't find the proper API or .plist file on my system to retrieve the Model Identifier of a Mac. (MacBookPro4,1 for an example)

I am also trying to retreive the main hard drive's serial number and processor information. All those info are available in the system profiler but I don't know how to get it from an API.

I could only find the Gestalt(gestaltSystemVersionMajor, &versMaj); to retrieve the Mac OS X version number but I can't find the other info that I need using the gestalt.
I am using cocoa.

Thanks for any help

Simon

Macbook Pro, Mac OS X (10.5.2)

Posted on Jul 8, 2008 11:26 AM

Reply
2 replies

Jul 8, 2008 11:34 AM in response to SimonGuertin

You can pull the model identifier from the IORegistry through IOKit. It's a bit involved to post any example code here, but the documentation is pretty decent, and the ioreg command can help you navigate the maze of classes you'll have to navigate through. In this case:

*ioreg -c IOPlatformExpertDevice -d 2*

will pull up the first bit of info you're looking for.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

retreive the model identifier: MacBookPro4,1

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.