I would like to get the Apple marketing name, the code name, for a given version of macOS (e.g. 10.12 is macOS Sierra) from Apple's online service at support-sp.apple.com/sp/product?edid=.

This is possible for some versions using the http request:

curl https://support-sp.apple.com/sp/product?edid=10.12.0

However, I cannot get the URL to give a consistent answer to https://support-sp.apple.com/sp/product?edid=<ver>.

I was trying to confirm my 10.13.6 version and kept getting errors. I tried 10.14.0 and it did not work. Trying 10.12.6 works, so I made a loop to try all versions:

$ for i in {6..14} ; do echo "10.${i}.0:" $(curl -s "https://support-sp.apple.com/sp/product?edid=10.${i}.0" | xmllint --format -xpath "//root/configCode/text()" - 2>/dev/null) ; done

returns: 10.6.0: Mac OS X 10.6 10.7.0: OS X Lion 10.8.0: OS X Mountain Lion 10.9.0: OS X Mavericks 10.10.0: 10.11.0: OS X El Capitan 10.12.0: macOS Sierra 10.13.0: 10.14.0:

If this isn't possible, is there a better place to ensure that when run from a bash shell on most macOS systems I can get the friendly name? At least the last 6 or so versions (I'm not sure how many pre-Lion versions there are out there in the wild).

You must log in to answer this question.

Browse other questions tagged .