Skip to content

Instantly share code, notes, and snippets.

@gretel
Last active June 12, 2018 20:20
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 gretel/a12502db68c274780ffe621d4f1389c4 to your computer and use it in GitHub Desktop.
Save gretel/a12502db68c274780ffe621d4f1389c4 to your computer and use it in GitHub Desktop.
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=(
# 'com.apple.AirPlayUIAgent' \
'com.apple.AirPortBaseStationAgent' \
# 'com.apple.AOSPushRelay' \
'com.apple.appleseed.seedusaged' \
'com.apple.assistant_service' \
'com.apple.assistantd' \
# 'com.apple.CalendarAgent' \
# 'com.apple.CallHistoryPluginHelper' \
# 'com.apple.CallHistorySyncHelper' \
# 'com.apple.cloudd' \
# 'com.apple.cloudpaird' \
# 'com.apple.cloudphotosd' \
'com.apple.CommCenter-osx' \
'com.apple.DictationIM' \
# 'com.apple.familycircled' \
# 'com.apple.familycontrols.useragent' \
# 'com.apple.familynotificationd' \
'com.apple.gamed' \
# 'com.apple.icloud.findmydeviced.findmydevice-user-agent' \
# 'com.apple.icloud.fmfd' \
# 'com.apple.iCloudUserNotifications' \
# 'com.apple.identityservicesd' \
# 'com.apple.imagent' \
'com.apple.IMLoggingAgent' \
'com.apple.Maps.pushdaemon' \
'com.apple.parentalcontrols.check' \
'com.apple.parsecd' \
'com.apple.passd' \
'com.apple.personad' \
'com.apple.photoanalysisd' \
'com.apple.screensharing.MessagesAgent' \
# 'com.apple.security.cloudkeychainproxy3' \
# 'com.apple.security.idskeychainsyncingproxy' \
# 'com.apple.security.keychain-circle-notification' \
'com.apple.security.keychainsyncingoveridsproxy' \
# 'com.apple.sharingd' \
# 'com.apple.syncdefaultsd' \
# 'com.apple.telephonyutilities.callservicesd' \
)
for agent in "${TODISABLE[@]}"
do
{
sudo launchctl unload -w /System/Library/LaunchAgents/${agent}.plist
launchctl unload -w /System/Library/LaunchAgents/${agent}.plist
} &> /dev/null
sudo mv /System/Library/LaunchAgents/${agent}.plist /System/Library/LaunchAgents/${agent}.plist.bak
echo "[OK] Agent ${agent} disabled"
done
# Daemons to disable
TODISABLE=(
# 'com.apple.AirPlayXPCHelper' \
# 'com.apple.AOSNotificationOSX' \
'com.apple.appleseed.fbahelperd' \
'com.apple.apsd' \
'com.apple.awacsd' \
# 'com.apple.eapolcfg_auth' \
'com.apple.familycontrols' \
# 'com.apple.findmymac' \
# 'com.apple.findmymacmessenger' \
# 'com.apple.icloud.findmydeviced' \
# 'com.apple.locationd' \
'com.apple.spindump' \
'com.apple.tailspind' \
'com.apple.ManagedClient' \
'com.apple.ManagedClient.cloudconfigurationd' \
'com.apple.ManagedClient.enroll' \
'com.apple.ManagedClient.startup' \
# 'com.apple.mbicloudsetupd' \
# 'com.apple.netbiosd' \
'com.apple.preferences.timezone.admintool' \
# 'com.apple.remotepairtool' \
'com.apple.rpmuxd' \
'com.apple.screensharing' \
'com.apple.security.FDERecoveryAgent' \
# 'com.apple.SubmitDiagInfo'
)
for daemon in "${TODISABLE[@]}"
do
{
sudo launchctl unload -w /System/Library/LaunchDaemons/${daemon}.plist
launchctl unload -w /System/Library/LaunchDaemons/${daemon}.plist
} &> /dev/null
sudo mv /System/Library/LaunchDaemons/${daemon}.plist /System/Library/LaunchDaemons/${daemon}.plist.bak
echo "[OK] Daemon ${daemon} disabled"
done
@gretel
Copy link
Author

gretel commented Jun 12, 2018

being conservative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment