Skip to content

Instantly share code, notes, and snippets.

@poundbangbash
Created February 25, 2015 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poundbangbash/f7b2a54416a5d9c2382c to your computer and use it in GitHub Desktop.
Save poundbangbash/f7b2a54416a5d9c2382c to your computer and use it in GitHub Desktop.
Repro
First, create a plist file with the keys you want to manage.
defaults write my.great.app setting1 -string foobar
defaults write my.great.app setting2 -bool false
defaults read my.great.app
{
setting1 = foobar;
setting2 = 0;
}
mcxToProfile to create a Profile to manage the domain "often".
mcxToProfile.py --plist ~/Library/Preferences/my.great.app.plist --identifier MyGreatApp --manage Often
Setup an unmanaged test VM or use a test machine running Yosemite.
Copy the profile to the test machine and install it
sudo profiles -IF MyGreatApp.mobileconfig
You can see the preferences have been applied by running
`defaults read my.great.app`
Add some custom preferences after the Profile was installed:
defaults write my.great.app setting3 -string Chickens
defaults write my.great.app setting4 -int 42
defaults read my.great.app
{
setting1 = foobar;
setting2 = 0;
setting3 = Chickens;
setting4 = 42;
}
Log out and back into OS X and read the plist again.
defaults read my.great.app
{
setting1 = foobar;
setting2 = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment