In OS X Yosemite it's possible to have preferences that are shared between multiple apps that are in the same App Group. On the development side of things it's as simple as setting up the App Group and then using
[[NSUserDefaults alloc] initWithSuiteName:@"TEAMID.com.company.AppGroup"] instead of the usual
[NSUserDefaults standardUserDefaults]. These preferences get stored in
What I'm trying to figure out is how to modify those preferences from outside of the app using the defaults command. So far the best I've found is this:
defaults write ~/Library/Group\ Containers/TEAMID.com.company.AppGroup/Library/Preferences/TEAMID.com.company.AppGroup PreferenceName -bool YES
This sort of works in that it modifies the correct .plist file and updates the preferences I tell it to. But it doesn't seem to be compatible with the caching that's used in Yosemite. As soon as the app tries to read the same preference, it reverts back to what was set previously.
Is there any way to make this work reliably?