bramus / freshinstall

Automatically configure and install software onto your new Mac
https://www.bram.us/2018/01/08/setting-up-macos-with-freshinstall/
MIT License
106 stars 15 forks source link

Settings: Safari: Enable Developer Mode #26

Open bramus opened 2 years ago

bramus commented 2 years ago

The old code no longer works

It should be possible to set similar options in ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist using PlistBuddy, but that file cannot be opened (without disabling SIP)

bramus commented 2 years ago

According to https://lapcatsoftware.com/articles/containers.html one needs to:

  1. Grant Terminal Full Disk Access
  2. Remove the file ~/Library/Preferences/com.apple.Safari.plist

From then on, using defaults write will know that it should write the settings in the ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist file.

While this does seem to be the case, the settings are not picked up by Safari …

bramus in ~ λ rm ~/Library/Preferences/com.apple.Safari.plist

bramus in ~ λ defaults write com.apple.Safari IncludeInternalDebugMenu -bool true                                                                               
bramus in ~ λ /usr/libexec/PlistBuddy -c "Print :IncludeInternalDebugMenu" ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist
true

bramus in ~ λ /usr/libexec/PlistBuddy -c "Print :HomePage" ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist
http://www.apple.com/uk/startpage/
bramus in ~ λ /usr/libexec/PlistBuddy -c "Set :HomePage about:blank" ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist
bramus in ~ λ /usr/libexec/PlistBuddy -c "Print :HomePage" ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist          
about:blank

bramus in ~ λ /usr/libexec/PlistBuddy -c "Set :AutoOpenSafeDownloads true" ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist
bramus in ~ λ /usr/libexec/PlistBuddy -c "Print :AutoOpenSafeDownloads" ~/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist
true

All attempts above had no effect :-/