Skip to content

Instantly share code, notes, and snippets.

@arivero
Forked from mtunjic/disable.sh
Created June 25, 2023 18:36
Show Gist options
  • Save arivero/6a0ca1c0a6ec2e0c944477fa02f639e6 to your computer and use it in GitHub Desktop.
Save arivero/6a0ca1c0a6ec2e0c944477fa02f639e6 to your computer and use it in GitHub Desktop.
Disable bunch of #$!@ in Catalina
#!/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
# 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
# see what’s running
# launchctl list
# launchctl list | wc -l
# sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.[name]
# to revert mv ./System/Library/LaunchDaemons/${daemon}.plist.bak ./System/Library/LaunchDaemons/${daemon}.plist
# sharingd
# airportd mDNSRespo
# com.apple.progressd, bird
# com.apple.AppleFileServer.plist
mount -uw /
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' \
# # cloudphotod is the iCloud Photos agent. It is responsible for all iCloud Photos activity.
# 'com.apple.cloudphotod' \
# 'com.apple.followupd' \
# 'com.apple.bird' \
# # bird -- Documents in the Cloud
# # bird is one of the system daemons backing the Documents in the Cloud feature.
# 'com.apple.iCloudUserNotificationsd' \
# 'com.apple.protectedcloudstorage.protectedcloudkeysyncing')
# iCloud
# -----------
# It’s a data logging daemon. It collects your usage data and
# sends it to apple and/or app devs for analytics.
TODISABLE+=('com.apple.analyticsd')
# Safari useless stuff
# TODISABLE+=('com.apple.SafariBookmarksSyncAgent' \
# 'com.apple.SafariCloudHistoryPushAgent' \
# 'com.apple.webinspectord
# # webinspectord relays commands between Web Inspector and targets that it can remotely
# # inspect, such as WKWebView and JSContext instances.
#
# 'com.apple.SafariPlugInUpdateNotifier' \
# 'com.apple.WebKit.PluginAgent')
# iMessage / Facetime
# TODISABLE+=('com.apple.imagent' \
# 'com.apple.imautomatichistorydeletionagent' \
# 'com.apple.imklaunchagent' \
# 'com.apple.imtransferagent' \
# 'com.apple.identityservicesd' \
# 'com.apple.avconferenced')
# Game Center / Passbook / Apple TV / Homekit...
TODISABLE+=('com.apple.gamed' \
'com.apple.passd' \
'com.apple.Maps.pushdaemon' \
'com.apple.videosubscriptionsd' \
'com.apple.CommCenter-osx' \
# homed is a daemon that manages home state and controls HomeKit accessories.
'com.apple.homed')
# Screensharing
TODISABLE+=('com.apple.screensharing.MessagesAgent' \
'com.apple.screensharing.agent' \
'com.apple.screensharing.menuextra')
# Siri
TODISABLE+=('com.apple.siriknowledged' \
# 'com.apple.assistant_service' \
# 'com.apple.assistantd' \
# 'com.apple.siri-distributed-evaluation' \
# 'com.apple.siri.context.service
# parsecd -- Support daemon for Siri Suggestions
# parsecd it is location-based suggestions for Siri.
'com.apple.parsecd' \
'com.apple.Siri.agent' \
'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')
# parentalcontrols
TODISABLE+=('com.apple.familycircled' \
'com.apple.familycontrols.useragent' \
'com.apple.familynotificationd' \
'com.apple.parentalcontrols.check')
# AirPlay
TODISABLE+=('com.apple.AirPlayUIAgent' \
'com.apple.AirPortBaseStationAgent')
# Media analitics
# mediaanalysisd photos that's identifying faces and objects. It is CPU intensive process
TODISABLE+=('com.apple.amp.mediasharingd' \
'com.apple.mediaanalysisd' \
'com.apple.mediaremoteagent' \
'com.apple.photoanalysisd' \
'com.apple.mediaremoted')
#AMPArtworkAgent -- The artwork agent for Music.app, TV.app, and iOS/iPod device syncing
# iTunes
# TODISABLE+=('com.apple.AOSPushRelay' \
# 'com.apple.AOSHeartbeat' \
# 'com.apple.AMPArtworkAgent')
# Ad-related (advertising privacy services daemon)
TODISABLE+=('com.apple.ap.adprivacyd' \
'com.apple.ap.adservicesd')
# Net
# Others
TODISABLE+=('com.apple.telephonyutilities.callservicesd' \
#'com.apple.findmymacmessenger' \
# sharingd is used by the Finder to enable AirDrop file sharing, connecting to
# shared computers, and accessing Remote Discs from other computers.
#'com.apple.sharingd' \
# identityservicesd is a background process (Identity Services Daemon) that deals with
# third-party credentials.
# It can sometimes be responsible for rapid battery loss. A possible solution may be to sign
# out and back into the various accounts set up on your iPhone
# (Facebook , App Store, Twitter, Tumblr and others). ! WARN facetime and messages depend
#'com.apple.identityservicesd' \
'com.apple.java.InstallOnDemand' \
#'com.apple.security.keychain-circle-notification' \
# syncdefaultsd is the system daemon backing the NSUbiquitousKeyValueStore feature.
#'com.apple.syncdefaultsd' \
# seedusaged -feedback assistant?
#'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' \
# suggestd -- daemon that processes user content in order to detect contacts, events, named entities, etc.
# 'com.apple.suggestd' \
#'com.apple.AddressBook.abd' \
# helpd is a macOS agent that manages software documentation.
# 'com.apple.helpd' \
# mediasharingd is a per-user daemon which manages the user's media library sharing.
# 'com.apple.remindd' \
)
for agent in "${TODISABLE[@]}"
do
mv ./System/Library/LaunchAgents/${agent}.plist ./System/Library/LaunchAgents/${agent}.plist.bak
echo "[OK] Agent ${agent} disabled"
done
# Daemons to disable
TODISABLE=()
# Net
# 'com.apple.locate' \
# 'com.apple.locationd' \
TODISABLE+=('com.apple.netbiosd' \
#'com.apple.preferences.timezone.admintool' \
'com.apple.remotepairtool' \
# Full Disk Encryption Key Recovery Transmission Agent
# sends encrypted CoreStorage key recovery information to Apple. It is run
# only when "Store the recovery key with Apple" is selected, and even then only if the infor-
# mation could not be transmitted when that option was first selected.
#'com.apple.security.FDERecoveryAgent' \
'com.apple.SubmitDiagInfo' \
'com.apple.screensharing' \
# fbahelperd feedback assistant
'com.apple.appleseed.fbahelperd' \
# apsd ApplePushService daemon for Apple Push Notification service. This is part of the
# ApplePushService framework.
# 'com.apple.apsd' \
# Device Enollment (prevents installation of mobileconfig profiles)
# 'com.apple.ManagedClient.cloudconfigurationd' \
# 'com.apple.ManagedClient.enroll' \
# 'com.apple.ManagedClient' \
# 'com.apple.ManagedClient.startup' \
# eapolcfg_auth daemon used to configure EAP over LAN (EAPOL).
# allows an authorized process to perform privileged EAPOL configuration operations.
'com.apple.eapolcfg_auth' \
'com.apple.RemoteDesktop.PrivilegeProxy' \
# com.apple.recentsd
# recentsd is used by Mail, Messages, and other apps on the system. It keeps track of recently used email addresses, phone numbers, and locations so
# you can use them again without adding them to your address book.
# -------------------------------------------------------------------------------
'com.apple.progressd' \
# progressd is the ClassKit sync agent. It handles syncing classes, class members,
# student handouts and progress data between student and teacher managed Apple ID accounts.
'com.apple.ctkbind' \
#ctkbind is a SmartCard paring tool that associates a user with a SmartCard public key.
'com.apple.facebook.xpc' \
'com.apple.linkedin.xpc' \
'com.apple.podcasts.PodcastContentService' \
'com.apple.twitter.xpc' \
'com.apple.EscrowSecurityAlert' \
'com.apple.routined' \
# routined -- A daemon that learns the historical location patterns of a user.
# routined is a per-user daemon that learns historical location patterns of a user and predicts future visits to locations.
'com.apple.icdd' \
#icdd -- ImageCapture Discovery Daemon
#icdd is a system daemon responsible for matching devices containing images with the appropriate driver modules.
# Bonjour - it advertises available services.' (old)
'com.apple.contacts.donation-agent')
for daemon in "${TODISABLE[@]}"
do
mv ./System/Library/LaunchDaemons/${daemon}.plist ./System/Library/LaunchDaemons/${daemon}.plist.bak
echo "[OK] Daemon ${daemon} disabled"
done
#!/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 TOENABLE 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
# '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
# see what’s running
# launchctl list
# launchctl list | wc -l
# sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.[name]
# to revert mv ./System/Library/LaunchDaemons/${daemon}.plist.bak ./System/Library/LaunchDaemons/${daemon}.plist
mount -uw /
TOENABLE=()
# iCloud
# TOENABLE+=('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' \
# # cloudphotod is the iCloud Photos agent. It is responsible for all iCloud Photos activity.
# 'com.apple.cloudphotod' \
# 'com.apple.followupd' \
# 'com.apple.bird' \
# # bird -- Documents in the Cloud
# # bird is one of the system daemons backing the Documents in the Cloud feature.
# 'com.apple.iCloudUserNotificationsd' \
# 'com.apple.protectedcloudstorage.protectedcloudkeysyncing')
# iCloud
# -----------
# It’s a data logging daemon. It collects your usage data and
# sends it to apple and/or app devs for analytics.
TOENABLE+=('com.apple.analyticsd')
# Safari useless stuff
# TOENABLE+=('com.apple.SafariBookmarksSyncAgent' \
# 'com.apple.SafariCloudHistoryPushAgent' \
# 'com.apple.webinspectord
# # webinspectord relays commands between Web Inspector and targets that it can remotely
# # inspect, such as WKWebView and JSContext instances.
#
# 'com.apple.SafariPlugInUpdateNotifier' \
# 'com.apple.WebKit.PluginAgent')
# iMessage / Facetime
# TOENABLE+=('com.apple.imagent' \
# 'com.apple.imautomatichistorydeletionagent' \
# 'com.apple.imklaunchagent' \
# 'com.apple.imtransferagent' \
# 'com.apple.identityservicesd' \
# 'com.apple.avconferenced')
# Game Center / Passbook / Apple TV / Homekit...
TOENABLE+=('com.apple.gamed' \
'com.apple.passd' \
'com.apple.Maps.pushdaemon' \
'com.apple.videosubscriptionsd' \
'com.apple.CommCenter-osx' \
# homed is a daemon that manages home state and controls HomeKit accessories.
'com.apple.homed')
# Screensharing
TOENABLE+=('com.apple.screensharing.MessagesAgent' \
'com.apple.screensharing.agent' \
'com.apple.screensharing.menuextra')
# Siri
TOENABLE+=('com.apple.siriknowledged' \
# 'com.apple.assistant_service' \
# 'com.apple.assistantd' \
# 'com.apple.siri-distributed-evaluation' \
# 'com.apple.siri.context.service
# parsecd -- Support daemon for Siri Suggestions
# parsecd it is location-based suggestions for Siri.
'com.apple.parsecd' \
'com.apple.Siri.agent' \
'com.apple.parsec-fbf')
# VoiceOver / accessibility-related stuff
TOENABLE+=('com.apple.VoiceOver' \
'com.apple.voicememod' \
'com.apple.accessibility.AXVisualSupportAgent' \
'com.apple.accessibility.dfrhud' \
'com.apple.accessibility.heard')
# Quicklook
# TOENABLE+=('com.apple.quicklook.ui.helper' \
# 'com.apple.quicklook.ThumbnailsAgent' \
# 'com.apple.quicklook')
# Sidecar
TOENABLE+=('com.apple.sidecar-hid-relay' \
'com.apple.sidecar-relay')
# Debugging process
# TOENABLE+=('com.apple.spindump_agent' \
# 'com.apple.ReportCrash' \
# 'com.apple.ReportGPURestart' \
# 'com.apple.ReportPanic' \
# 'com.apple.DiagnosticReportCleanup' \
# 'com.apple.TrustEvaluationAgent')
# Screentime
TOENABLE+=('com.apple.ScreenTimeAgent' \
'com.apple.UsageTrackingAgent')
# parentalcontrols
TOENABLE+=('com.apple.familycircled' \
'com.apple.familycontrols.useragent' \
'com.apple.familynotificationd' \
'com.apple.parentalcontrols.check')
# AirPlay
TOENABLE+=('com.apple.AirPlayUIAgent' \
'com.apple.AirPortBaseStationAgent')
# Media analitics
# mediaanalysisd photos that's identifying faces and objects. It is CPU intensive process
TOENABLE+=('com.apple.amp.mediasharingd' \
'com.apple.mediaanalysisd' \
'com.apple.mediaremoteagent' \
'com.apple.photoanalysisd' \
'com.apple.mediaremoted')
#AMPArtworkAgent -- The artwork agent for Music.app, TV.app, and iOS/iPod device syncing
# iTunes
# TOENABLE+=('com.apple.AOSPushRelay' \
# 'com.apple.AOSHeartbeat' \
# 'com.apple.AMPArtworkAgent')
# Ad-related (advertising privacy services daemon)
TOENABLE+=('com.apple.ap.adprivacyd' \
'com.apple.ap.adservicesd')
# Net
# Others
TOENABLE+=('com.apple.telephonyutilities.callservicesd' \
#'com.apple.findmymacmessenger' \
# sharingd is used by the Finder to enable AirDrop file sharing, connecting to
# shared computers, and accessing Remote Discs from other computers.
#'com.apple.sharingd' \
# identityservicesd is a background process (Identity Services Daemon) that deals with
# third-party credentials.
# It can sometimes be responsible for rapid battery loss. A possible solution may be to sign
# out and back into the various accounts set up on your iPhone
# (Facebook , App Store, Twitter, Tumblr and others). ! WARN facetime and messages depend
#'com.apple.identityservicesd' \
'com.apple.java.InstallOnDemand' \
#'com.apple.security.keychain-circle-notification' \
# syncdefaultsd is the system daemon backing the NSUbiquitousKeyValueStore feature.
#'com.apple.syncdefaultsd' \
# seedusaged -feedback assistant?
#'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' \
# suggestd -- daemon that processes user content in order to detect contacts, events, named entities, etc.
# 'com.apple.suggestd' \
#'com.apple.AddressBook.abd' \
# helpd is a macOS agent that manages software documentation.
# 'com.apple.helpd' \
# mediasharingd is a per-user daemon which manages the user's media library sharing.
# 'com.apple.remindd' \
)
for agent in "${TOENABLE[@]}"
do
mv ./System/Library/LaunchAgents/${agent}.plist.bak ./System/Library/LaunchAgents/${agent}.plist
echo "[OK] Agent ${agent} disabled"
done
# Daemons to disable
TOENABLE=()
# Net
# 'com.apple.locate' \
# 'com.apple.locationd' \
TOENABLE+=('com.apple.netbiosd' \
#'com.apple.preferences.timezone.admintool' \
'com.apple.remotepairtool' \
# Full Disk Encryption Key Recovery Transmission Agent
# sends encrypted CoreStorage key recovery information to Apple. It is run
# only when "Store the recovery key with Apple" is selected, and even then only if the infor-
# mation could not be transmitted when that option was first selected.
#'com.apple.security.FDERecoveryAgent' \
'com.apple.SubmitDiagInfo' \
'com.apple.screensharing' \
# fbahelperd feedback assistant
'com.apple.appleseed.fbahelperd' \
# apsd ApplePushService daemon for Apple Push Notification service. This is part of the
# ApplePushService framework.
# 'com.apple.apsd' \
# Device Enollment (prevents installation of mobileconfig profiles)
# 'com.apple.ManagedClient.cloudconfigurationd' \
# 'com.apple.ManagedClient.enroll' \
# 'com.apple.ManagedClient' \
# 'com.apple.ManagedClient.startup' \
# eapolcfg_auth daemon used to configure EAP over LAN (EAPOL).
# allows an authorized process to perform privileged EAPOL configuration operations.
'com.apple.eapolcfg_auth' \
'com.apple.RemoteDesktop.PrivilegeProxy' \
# com.apple.recentsd
# recentsd is used by Mail, Messages, and other apps on the system. It keeps track of recently used email addresses, phone numbers, and locations so
# you can use them again without adding them to your address book.
# -------------------------------------------------------------------------------
'com.apple.progressd' \
# progressd is the ClassKit sync agent. It handles syncing classes, class members,
# student handouts and progress data between student and teacher managed Apple ID accounts.
'com.apple.ctkbind' \
#ctkbind is a SmartCard paring tool that associates a user with a SmartCard public key.
'com.apple.facebook.xpc' \
'com.apple.linkedin.xpc' \
'com.apple.podcasts.PodcastContentService' \
'com.apple.twitter.xpc' \
'com.apple.EscrowSecurityAlert' \
'com.apple.routined' \
# routined -- A daemon that learns the historical location patterns of a user.
# routined is a per-user daemon that learns historical location patterns of a user and predicts future visits to locations.
'com.apple.icdd' \
#icdd -- ImageCapture Discovery Daemon
#icdd is a system daemon responsible for matching devices containing images with the appropriate driver modules.
# Bonjour - it advertises available services.' (old)
'com.apple.contacts.donation-agent')
for daemon in "${TOENABLE[@]}"
do
mv ./System/Library/LaunchDaemons/${daemon}.plist.bak ./System/Library/LaunchDaemons/${daemon}.plist
echo "[OK] Daemon ${daemon} disabled"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment