My swift program periodically updates the com.google.Chrome.plist
file stored in /Library/Preferences
.
During the initial executions, it just needs a restart of Chrome browser for the policies to take effect. But now I need to restart the system to make the policies to take effect. How do I get it to update without restarting the Mac?
And also the Reload policies
button in chrome://policy
won't do the trick. (I wonder what's its purpose?)
And also, please explain the difference between placing the plist file in /Library/Preferences
and in /Library/Managed Preferences
Or is there any command for OS X, like gpupdate /force
(for windows) as they said here.
I also recently found that this problem persists for other apps too ( I tried editing the plist file of Safari from ~/Library/Preferences/com.apple.Safari.plist
and it requires a system reboot to take effect )
I'm stuck here for long. A nudge in the possible direction would do too!
Thank you!
plist - The primary property list for Mac OS X applications, located in the /Contents/ directory of an . APP bundle. To view this file, right-click an application file, select "Show Package Contents," and open the Contents folder.
Preference and configuration files in macOS use property lists (plists) to specify the attributes, or properties, of an app or process. An example is the preferences plist for the Finder in the Library/Preferences/ folder of a user's home folder. The file is named com. apple.
They are stored in ~/Library/Preferences/com. apple. systempreferences. plist.
The reason is, from Mac OS Mavericks, apple started to cache plist files, which results in replacing a plist file manually has no effect until the cache is reloaded automatically. If you open the application which uses this plist file to early, it overwrites your copied file with the old/cached one.
To reload the preference file manually, use defaults read <filename>.plist
to read the new plist values.
Source: nethack
Now, I just use a sh
script to call the defaults
after executing my program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With