This is kind of a weird one, does anyone know what contains the information of the version of macOS? is it written to some file? If so where does the file reside and can it be edited to a different version of macOS?

  • 1
    Possible duplicate: unix.stackexchange.com/q/582/117549 – Jeff Schaller Jun 14 '19 at 18:55
  • 1
    If the release number was available in a file, and you changed it, it would not change the release of macOS installed on the machine. What is it that you are trying to do? – Kusalananda Jun 14 '19 at 19:05
  • 1
    thanks for the reply, i am testing a feature that scans for a version of macOS, so if a user is on a version older than 12.x.x it should throw an error, I want to test this without imaging a mac device with an older version like 10.11.x, to save some time i want to see if I can edit the /System/LIbrary/CoreServices/SystemVersion file to set it to an older version of macOS (temporarily) – as134_user3693277 Jun 14 '19 at 20:42

You can use sw_vers to determine this:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.5
BuildVersion:   18F132

Or, for a more succinct answer:

$ sw_vers | awk '$1 ~ /ProductVersion/ { print $2 }'
  • thanks for the reply, I know there are several ways to get the current version of macOS (such as "system_profiler SPSoftwareDataType), I'm wondering if i can edit the version of macOS in order to trick the system into thinking that it is something older (temporarily). – as134_user3693277 Jun 14 '19 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.