6

Does Mac OS X have API that translates Apple's model identifiers (the kind found in plists and APIs, e.g., "MacBookPro5,1") to user-friendly marketing names of these devices ("Unibody MacBook Pro Late 2008")?

I'm looking for more future-proof solution than simply hardcoding a list.

Kornel
  • 97,764
  • 37
  • 219
  • 309

4 Answers4

3

You could access the following property list to get the human friendly name.

/System/Library/PrivateFrameworks/ServerInformation.framework/Versions/A/Resources/English.lproj/SIMachineAttributes.plist

Itachi
  • 5,777
  • 2
  • 37
  • 69
1

Try scraping this Wikipedia page: http://en.wikipedia.org/wiki/Timeline_of_Apple_Macintosh_models

Of course, this isn't guaranteed to continue to work, but it's a start.

Pat McGee
  • 458
  • 3
  • 10
0

One of the better options I've found was answered at https://apple.stackexchange.com/questions/98080/can-a-macs-model-year-be-determined-with-a-terminal-command.

In short, you can query Apple's servers for the marketing name of the computer using the last 4 characters of the hardware's serial number.

https://support-sp.apple.com/sp/product?cc=XXXX

For example

https://support-sp.apple.com/sp/product?cc=G8WL
n8felton
  • 322
  • 2
  • 16
-1

There's no table built into the Apple libraries for that. Sorry.

John Franklin
  • 4,962
  • 1
  • 23
  • 27