macOS version and patching info via api

Hello, I'm trying to reliably determine version info on macOS for a patching and posturing app but given how Apple releases security patches and doesn't necessarily increment version number, disparate build number with no reliable or consistent way to validate a build per model vs patch release, does anyone know of a good way (or recommended way) to validate patch compliance on supported (non-EOL) macOS versions?

Maybe try the NSProcessInfo property operatingSystemVersion?

That returns NSIntegers for majorVersion, minorVersion, and patchVersion.

I don't have an easy way to test the patchVersion update; to see when (if?) that gets incremented.

thanks a bunch! but how would i verify what the latest version is, like, authoritatively? is there an apple service w/ a public api like the backend to software updates in system settings?

macOS version and patching info via api
 
 
Q