Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch macos detection to use SystemVersion.plist #333

Open
orf opened this issue Jan 31, 2023 · 2 comments
Open

Switch macos detection to use SystemVersion.plist #333

orf opened this issue Jan 31, 2023 · 2 comments

Comments

@orf
Copy link

orf commented Jan 31, 2023

The way Python detects the MacOS version uses the file /System/Library/CoreServices/SystemVersion.plist:

❯ cat /System/Library/CoreServices/SystemVersion.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>ProductBuildVersion</key>
    <string>22D49</string>
    <key>ProductCopyright</key>
    <string>1983-2023 Apple Inc.</string>
    <key>ProductName</key>
    <string>macOS</string>
    <key>ProductUserVisibleVersion</key>
    <string>13.2</string>
    <key>ProductVersion</key>
    <string>13.2</string>
    <key>iOSSupportVersion</key>
    <string>16.3</string>
</dict>
</plist>

Would it be faster and potentially more efficient to use this rather than invoking sw_vers and parsing the output?

@stanislav-tkach
Copy link
Owner

Thank you for the suggestion, I think it is a good idea. I can do that myself, but please let me know if you want to try to implement that. 🙃

@orf
Copy link
Author

orf commented Feb 4, 2023

I love to try and implement it, thanks! I’ll give it a shot this weekend or next weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants