How do I use the defaults command with App Groups?
As far as I've been able to determine there's still no proper way to do this. However, you can make it work by killing cfprefsd after using the above command. So I just use something like this in the Terminal app:

defaults write ~/Library/Group\ Containers/TEAMID.com.company.AppGroup/Library/Preferences/TEAMID.com.company.AppGroup PreferenceName -bool YES; killall cfprefsd

Not great, but better than nothing.

Update for macOS Sierra (10.12): Unfortunately using the file path doesn't seem to work anymore. Strangely it works on files that are elsewhere—like if I copy an App Group plist to the desktop—but I can't get it to work right on an App Group plist in its normal location.

It's worth noting that man defaults has included this note for a while:


  The defaults command will be changed in an upcoming major release to only operate on preferences domains. General plist manipulation utilities will be folded into a different command-line program.


Like I said though, this isn't an issue with arbitrary plists, it seems specific to plists in ~/Library/Group Containers/.