2

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?

3
  • 1
    Possible duplicate: unix.stackexchange.com/q/582/117549
    – Jeff Schaller
    Commented Jun 14, 2019 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
    Commented Jun 14, 2019 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) Commented Jun 14, 2019 at 20:42

1 Answer 1

1

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 }'
10.14.5
1
  • 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). Commented Jun 14, 2019 at 20:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .