macOS 27.0 beta 4
I have an installer app which needs to set a key/value inside a plist file during installation. This is for a screensaver that runs under the legacyScreensaver system, so the plist lives at:
~/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver.x86-64/Data/Library/Preferences/com.foobar.plist
Although I can see the plist file in the Finder, my installer app can't read or write it, and the NSAppDataUsageDescription string is not shown, nor does the OS ask the user for permission.
Also, trying to do this via the Terminal app is also blocked (even using 'sudo'). I understand this is part of the new Golden Gate security system.
In Golden Gate, is there a legitimate way to accomplish this so it works like it did in macOS 26 and earlier?
I'd like my installer to request access, the NSAppDataUsageDescription string is shown, and the user can grant or deny permission.
I agree that using Appex format would be ideal. I submitted FB24013514
Thank you.
As for workarounds using legacyScreenSaver
Yeah, that’s basically the direction I was gonna send you. It works because the process that loads and runs your screen saver isn’t tightly sandboxed [1].
The only question is whether it’s better to continue using the preferences subsystem or whether you can store this state in a file that’s entirely under your control (so a property list in ~/Library/Application Support/YOUR_PRODUCT_NAME). Honestly, I’d lean towards the latter. It has various benefits:
- It’s in the user’s home directory, so each user gets their own preferences.
- And you don’t need privilege escalation to write it.
- And while I can’t predict the future with 100% fidelity, my experience is that completely custom stuff is less likely to bump into these sorts of restrictions.
Oh, and if you want your screen saver to react on the fly to changes in this file, your app can post a distributed notification to tell the screen saver that it’s changed.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] It’s still sandboxed mind you, just not so tightly that it can’t access files on disk.