Last active
March 15, 2022 01:59
-
-
Save crowjdh/aa15b19b743fa3e42703c49aaa778f42 to your computer and use it in GitHub Desktop.
Disable bunch of #$!@ in Catalina - Note about Big Sur: https://gist.github.com/pwnsdx/1217727ca57de2dd2a372afdd7a0fc21#gistcomment-3448419
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it! | |
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS. | |
# This script needs to be run from the volume you wish to use. | |
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh | |
# 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 | |
if [ "$#" -lt 1 ]; then | |
printf "Usage: unload [doit|revert]" | |
exit 1 | |
fi | |
MODE=$1 | |
BASE_DIR=./System/Library | |
# Agents to disable | |
# 'com.apple.speech.speechdatainstallerd' 'com.apple.speech.speechsynthesisd' 'com.apple.speech.synthesisserver' will freeze Edit menus | |
# 'com.apple.bird' will prevent saving prompt from being shown | |
TODISABLE=() | |
# iCloud | |
TODISABLE+=('com.apple.security.cloudkeychainproxy3' \ | |
'com.apple.iCloudUserNotifications' \ | |
'com.apple.icloud.findmydeviced.findmydevice-user-agent' \ | |
'com.apple.icloud.fmfd' \ | |
'com.apple.icloud.searchpartyuseragent' \ | |
'com.apple.cloudd' \ | |
'com.apple.cloudpaird' \ | |
'com.apple.cloudphotosd' \ | |
# Follow up notification | |
'com.apple.followupd' \ | |
'com.apple.protectedcloudstorage.protectedcloudkeysyncing') | |
# Safari useless stuff | |
TODISABLE+=('com.apple.SafariBookmarksSyncAgent' \ | |
'com.apple.SafariCloudHistoryPushAgent' \ | |
'com.apple.WebKit.PluginAgent' \ | |
'com.apple.SafariPlugInUpdateNotifier' \ | |
) | |
# # iMessage / Facetime | |
# # TODISABLE+=('com.apple.imagent' \ | |
# # 'com.apple.imautomatichistorydeletionagent' \ | |
# # 'com.apple.imklaunchagent' \ | |
# # 'com.apple.imtransferagent' \ | |
# # 'com.apple.avconferenced') | |
# Game Center / Passbook / Apple TV / Homekit... | |
TODISABLE+=('com.apple.gamed' \ | |
'com.apple.passd' \ | |
'com.apple.Maps.pushdaemon' \ | |
# Itunes video subscription stuff | |
'com.apple.videosubscriptionsd' \ | |
'com.apple.CommCenter-osx' \ | |
'com.apple.homed') | |
# Ad-related | |
TODISABLE+=('com.apple.ap.adprivacyd' \ | |
'com.apple.ap.adservicesd') | |
# Screensharing | |
TODISABLE+=('com.apple.screensharing.MessagesAgent' \ | |
'com.apple.screensharing.agent' \ | |
'com.apple.screensharing.menuextra') | |
# Siri | |
TODISABLE+=(\ | |
'com.apple.siriknowledged' \ | |
'com.apple.assistant_service' \ | |
# This is what causes 'Security & Privacy' pane to show error dialog. | |
# https://github.com/n00neimp0rtant/Sirious/blob/master/Layout/System/Library/LaunchDaemons/com.apple.assistantd.plist | |
# 'com.apple.assistantd' \ | |
'com.apple.Siri.agent' \ | |
# Location-based suggestion | |
'com.apple.parsec-fbf' \ | |
) | |
# # VoiceOver / accessibility-related stuff | |
# # TODISABLE+=('com.apple.VoiceOver' \ | |
# # 'com.apple.voicememod' \ | |
# # 'com.apple.accessibility.AXVisualSupportAgent' \ | |
# # 'com.apple.accessibility.dfrhud' \ | |
# # 'com.apple.accessibility.heard') | |
# | |
# # # Quicklook | |
# # TODISABLE+=('com.apple.quicklook.ui.helper' \ | |
# # 'com.apple.quicklook.ThumbnailsAgent' \ | |
# # 'com.apple.quicklook') | |
# Sidecar | |
TODISABLE+=('com.apple.sidecar-hid-relay' \ | |
'com.apple.sidecar-relay') | |
# Debugging process | |
TODISABLE+=( \ | |
# 'com.apple.spindump_agent' \ | |
'com.apple.ReportCrash' \ | |
'com.apple.ReportGPURestart' \ | |
'com.apple.ReportPanic' \ | |
'com.apple.DiagnosticReportCleanup' \ | |
# 'com.apple.TrustEvaluationAgent' \ | |
) | |
# Screentime | |
TODISABLE+=('com.apple.ScreenTimeAgent' \ | |
'com.apple.UsageTrackingAgent') | |
# Others | |
TODISABLE+=('com.apple.telephonyutilities.callservicesd' \ | |
'com.apple.photoanalysisd' \ | |
# 'com.apple.parsecd' \ | |
'com.apple.AOSPushRelay' \ | |
'com.apple.AOSHeartbeat' \ | |
# 'com.apple.AirPlayUIAgent' \ | |
'com.apple.AirPortBaseStationAgent' \ | |
'com.apple.familycircled' \ | |
'com.apple.familycontrols.useragent' \ | |
'com.apple.familynotificationd' \ | |
'com.apple.findmymacmessenger' \ | |
# Maybe related to AirDrop | |
# 'com.apple.sharingd' \ | |
# 'com.apple.identityservicesd' \ | |
'com.apple.java.InstallOnDemand' \ | |
'com.apple.parentalcontrols.check' \ | |
# 'com.apple.security.keychain-circle-notification' \ | |
# iCloud sync | |
# 'com.apple.syncdefaultsd' \ | |
'com.apple.appleseed.seedusaged' \ | |
'com.apple.appleseed.seedusaged.postinstall' \ | |
'com.apple.CallHistorySyncHelper' \ | |
'com.apple.RemoteDesktop' \ | |
'com.apple.CallHistoryPluginHelper' \ | |
'com.apple.SocialPushAgent' \ | |
'com.apple.touristd' \ | |
'com.apple.macos.studentd' \ | |
# ??? | |
# 'com.apple.KeyboardAccessAgent' \ | |
'com.apple.exchange.exchangesyncd' \ | |
'com.apple.suggestd' \ | |
'com.apple.AddressBook.abd' \ | |
'com.apple.helpd' \ | |
'com.apple.amp.mediasharingd' \ | |
'com.apple.mediaanalysisd' \ | |
'com.apple.mediaremoteagent' \ | |
'com.apple.remindd' \ | |
# ??? | |
# 'com.apple.keyboardservicesd' \ | |
'com.apple.AddressBook.SourceSync' \ | |
'com.apple.telephonyutilities.callservicesd' \ | |
'com.apple.mobileassetd' \ | |
'com.apple.CalendarAgent' \ | |
# Siri's proactive knowledge collector...appearantly | |
'com.apple.knowledge-agent') | |
TODISABLE+=( | |
'com.apple.RemoteManagementAgent' \ | |
'com.apple.EscrowSecurityAlert' \ | |
'com.oracle.java.Java-Updater' \ | |
'com.apple.routined' \ | |
'com.apple.contacts.donation-agent' \ | |
'com.apple.AMPArtworkAgent' \ | |
'com.apple.diagnostics_agent' \ | |
'com.apple.photolibraryd' \ | |
'com.apple.WiFiVelocityAgent' \ | |
'com.apple.accessibility.MotionTrackingAgent' \ | |
) | |
for agent in "${TODISABLE[@]}" | |
do | |
if [ $MODE == "doit" ]; then | |
mv $BASE_DIR/LaunchAgents/${agent}.plist $BASE_DIR/LaunchAgentsIgnored/${agent}.plist.bak | |
else | |
mv $BASE_DIR/LaunchAgentsIgnored/${agent}.plist.bak $BASE_DIR/LaunchAgents/${agent}.plist | |
fi | |
echo "[OK] Agent ${agent} disabled" | |
done | |
# Daemons to disable | |
TODISABLE=() | |
# iCloud | |
TODISABLE+=('com.apple.analyticsd' 'com.apple.icloud.findmydeviced') | |
# Others | |
TODISABLE+=('com.apple.netbiosd' \ | |
'com.apple.preferences.timezone.admintool' \ | |
'com.apple.remotepairtool' \ | |
'com.apple.security.FDERecoveryAgent' \ | |
'com.apple.SubmitDiagInfo' \ | |
'com.apple.screensharing' \ | |
'com.apple.appleseed.fbahelperd' \ | |
'com.apple.apsd' \ | |
'com.apple.ManagedClient.cloudconfigurationd' \ | |
'com.apple.ManagedClient.enroll' \ | |
'com.apple.ManagedClient' \ | |
'com.apple.ManagedClient.startup' \ | |
'com.apple.locate' \ | |
'com.apple.locationd' \ | |
# 'com.apple.eapolcfg_auth' \ | |
'com.apple.RemoteDesktop.PrivilegeProxy' \ | |
'com.apple.mediaremoted'\ | |
'com.apple.ReportCrash.Root' \ | |
'com.apple.CrashReporterSupportHelper' \ | |
) | |
TODISABLE+=( \ | |
'com.apple.bluetoothReporter' \ | |
'com.apple.systemstats.daily' \ | |
'com.apple.systemstats.analysis' \ | |
'com.apple.systemstats.microstackshot_periodic' \ | |
'com.apple.cloudphotod' \ | |
'com.apple.rapportd' \ | |
'com.apple.findmymacmessenger' \ | |
'com.apple.wifivelocityd' \ | |
'com.apple.icloud.searchpartyd' \ | |
) | |
for daemon in "${TODISABLE[@]}" | |
do | |
if [ $MODE == "doit" ]; then | |
mv $BASE_DIR/LaunchDaemons/${daemon}.plist $BASE_DIR/LaunchAgentsIgnored/${daemon}.plist.daemon.bak | |
else | |
mv $BASE_DIR/LaunchAgentsIgnored/${daemon}.plist.daemon.bak $BASE_DIR/LaunchDaemons/${daemon}.plist | |
fi | |
echo "[OK] Daemon ${daemon} disabled" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment