I like your suggestion, but I just tried it and it seems that ~/Library/Application Support/ is re-routed inside the container, e.g.
let rawPath = "~/Application Support/com.example/\(self.bundleID).plist"
let path = (rawPath as NSString).expandingTildeInPath
let url = URL(fileURLWithPath: path)
guard let dict = NSDictionary(contentsOf: url) as? [String: Any] else {
print("Error: Failed to read or parse plist at: \(path)")
When run in context of a .saver running inside LegacyScreenSaver, this happens:
Failed to read or parse plist at: /Users/username/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver.x86-64/Data/Application Support/com.example/com.example.foobar.plist
I did another test where, instead of using ~/Library/Application Support/ I used /Users/Shared/com.example and that one seemed to work.
Using /Users/Shared/ is not very elegant, but seems to be a location of last resort that some other apps use in some cases.
Am I missing something? Is there a way from inside a sandbox, to get to the real ~/Library/Application Support/ folder, not the containerized one?
Topic:
Privacy & Security
SubTopic:
General
Tags: