I have a key with values that I'd like to insert into .GlobalPreferences.plist. I've been able to insert these via the following steps:

mkdir ~/tmp; cd ~/tmp 
cp /path/to/some.plist ~/tmp/ 
cp ~/Library/Preferences/.GlobalPreferences.plist ~/tmp/
#Convert from binary plist to xml: 
plutil -convert xml1 .GlobalPreferences.plist
#Merge some values into the plist: 
/usr/libexec/PlistBuddy -x -c "Merge some.plist :ProperlyNamedKey" ~/tmp/.GlobalPreferences.plist
#Test to make sure values have been inserted to key: 
/usr/libexec/PlistBuddy -x -c "Print :ProperlyNamedKey"
#Reencode to binary plist: 
plutil -convert binary1 .GlobalPreferences.plist 
cp .GlobalPreferences.plist ~/Library/Preferences/ 

The key and accompanying values are merged fine, but when I cp the .GlobalPreferences.plist back over to the Preferences folder, the changes do NOT show up. When I sudo reboot the changes also vanish and no longer show up in the .GlobalPreferences.plist nor in System Preferences.

Is there a way to force macOS to accept and activate .GlobalPreferences.plist changes immediaely and such that the attempted changes are not wiped out?

  • You might try using the defaults command to accomplish this. I haven't tested it out myself, but defaults is typically used to modify plists from the CLI, so it might work. – GDP2 Jul 8 '17 at 2:10
  • @GDP2 PlistBuddy essentially does that but "better"... I don't think there would be any appreciable difference there in terms of activating the global preferences... – ylluminate Jul 8 '17 at 2:18

You must log in to answer this question.

Browse other questions tagged .