Wednesday, September 23, 2020

macOS Containers and defaults

Jeff Johnson:

If Terminal app has Full Disk Access, then defaults write com.apple.Safari is smart enough to use the preferences file in Safari’s container. But if Terminal does not have Full Disk Access, then defaults falls back to the preferences in the ~/Library/Preferences folder! So if you do defaults write com.apple.Safari IncludeInternalDebugMenu -bool true without Full Disk Access, it’ll write to ~/Library/Preferences/com.apple.Safari.plist, but that has no effect, because Safari is sandboxed and only reads preferences from its own container. Note that this happens even if there’s no old file at ~/Library/Preferences/com.apple.Safari.plist, because defaults will create a new file when necessary.

Previously:

Update (2020-11-02): See also: Dan Moren.

Comments RSS · Twitter

Leave a Comment