How to get the Mac OS version ?

My app is for iOS (not a Mac app). It can be installed and run on M1 Mac.

ProcessInfo().isiOSAppOnMac returns True .

In this case, is there any way to get the OS version information of the Mac device where this app is currently installed?

All APIs that get the current version information return the iOS version.

For example, Mac 12.0 returns iOS 15.

Mac 11.0 and Mac 12.0 both return to iOS 15. And some APIs started in iOS 15 crash on Mac 11.0.

So we currently want to know how we can get the Mac OS version information of the actual device in the above case.

(Additionally, not Mac Catalyst.)

What do you get when you call ProcessInfo.processInfo.operatingSystemVersion

var operatingSystemVersion: OperatingSystemVersion
The version of the operating system on which the process is executing.

How to get the Mac OS version ?
 
 
Q