It seems I can't edit the plist file from LaunchAgents — even if I sudo, I'm prevented from any deletion/alteration. Do I have to necessarily disable SIP to do this?
Disable the LaunchAgent (not LaunchDaemons) and reboot your machine (without sudo):
$ launchctl unload /System/Library/LaunchAgents/com.apple.gamed.plist
In case you want to enable it again at one point:
$ launchctl load /System/Library/LaunchAgents/com.apple.gamed.plist
According to this thread you can do:
defaults write com.apple.gamed Disabled -bool true
And to check the current state of the daemon use:
defaults read com.apple.gamed Disabled
The problem is that the accepted answer given above:
launchctl unload /System/Library/LaunchAgents/com.apple.gamed.plist
no longer works. I have also seen it using the
-w flag. In any case, in recent updates, I think around El Capitan or Yosemite, you instead get a message
Operation not permitted while System Integrity Protection is engaged
System Integrity Protection is also known by the acronym SIP. To disable it you need to boot into the Recovery OS and run
I have done this sequence in previous releases and it did lead to being able to disable gamed via the
I suppose that after gamed is disabled, one could re-enable SIP. Maybe that would be the best of both worlds, although it is a tedious process all in all.
One solution is to create a bash script to stop the gamed service after you login. Use Automator in OS X to create a bash script then add it as a Login Item to your OS X account. The next time you login you should receive a prompt to execute the script. Normally I wait until I see an alert from Little Snitch that gamed is phoning home then I click 'Continue' to run the script. This has not been perfected and you may encounter issues if you run it immediately after you login to OS X. I prefer to stay away from the solutions that disable the service as those require disabling/overriding SIP which I advise against.
Here is the bash script I use. Any suggestions on improving it are welcome.
#!/bin/bash chkService=gamed chkCount=10 chkStatus=$(ps ax | grep "$chkService" | grep -v grep | grep " T " | wc -l) while [ $chkStatus -ne 1 ]; do chkProcess=$(ps ax | grep -v grep | grep "$chkService" | wc -l) if [ $chkProcess -ne 0 ]; then KILLALL -STOP "$chkService" chkCount=0 chkStatus=$(ps ax | grep gamed | grep -v grep | grep " T " | wc -l) else SLEEP=1 chkCount=$((chkCount-1)) fi done
sudo launchctl unload /System/Library/Launch\ Daemons/com.apple.gamed.plist ?
on OS Sierra go to System Settings, Internet Accounts and delete (with the minus) the Game Center on the list (left side).
This makes little to no difference from a security standpoint as it simply reverts a system back to exactly ho wit worked prior to SIP, and exactly how almost all Unix systems still work. The value of SIP is at best debateable. It addresses the question because only way to use the Launchctl command to unload the gamed plist file is to first disable SIP, boot, unload the plist file, and then, if desired, reenable SIP.
You have to first enter
csrutil disable in Terminal when in Recovery Mode, then restart make changes, restart again in Recovery Mode and do
csrutil enable, restart.
But I do not know which processes when modified will compromise boot in El Capitan