macOS – Risks of Deleting System Processes or .plist Files

airplaylaunchdmacmacosplist

I am thinking of deleting some contents from /usr/libexec/ , I don't use AirPlay nor AirPort so if I delete these two processes will it again screw up my mac the processes are AirPlayXPCHelper and airportd

I don't even use Safari sync nor iCloud so I am thinking of deleting these .plist files /System/Library/LaunchAgents/com.apple.SafariCloudHistoryPushAgent.plist - 'com.apple.SafariCloudHistoryPushAgent'

What happened previously Accidentally deleted a system framework, macOS screwed! while messing with the OS

I am also thinking of running these commands to tweak my Mac

#!/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.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' '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.imagent' 'com.apple.cloudfamilyrestrictionsd-mac' 'com.apple.cloudpaird' 'com.apple.cloudphotosd' 'com.apple.DictationIM' 'com.apple.assistant_service' 'com.apple.CallHistorySyncHelper' 'com.apple.CallHistoryPluginHelper' 'com.apple.AOSPushRelay' 'com.apple.IMLoggingAgent' 'com.apple.geodMachServiceBridge' 'com.apple.syncdefaultsd' 'com.apple.security.cloudkeychainproxy3' 'com.apple.security.idskeychainsyncingproxy' 'com.apple.security.keychain-circle-notification' 'com.apple.sharingd' 'com.apple.appleseed.seedusaged' 'com.apple.cloudd' 'com.apple.assistantd' 'com.apple.parentalcontrols.check' 'com.apple.parsecd' 'com.apple.identityservicesd')

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.netbiosd' 'com.apple.preferences.timezone.admintool' 'com.apple.preferences.timezone.auto' 'com.apple.remotepairtool' 'com.apple.rpmuxd' 'com.apple.security.FDERecoveryAgent' 'com.apple.icloud.findmydeviced' 'com.apple.findmymacmessenger' 'com.apple.familycontrols' 'com.apple.findmymac' 'com.apple.SubmitDiagInfo' 'com.apple.screensharing' 'com.apple.appleseed.fbahelperd' 'com.apple.apsd' 'com.apple.AOSNotificationOSX' 'com.apple.FileSyncAgent.sshd' 'com.apple.ManagedClient.cloudconfigurationd' 'com.apple.ManagedClient.enroll' 'com.apple.ManagedClient' 'com.apple.ManagedClient.startup' 'com.apple.iCloudStats' 'com.apple.locationd' 'com.apple.mbicloudsetupd' 'com.apple.laterscheduler' 'com.apple.awacsd' 'com.apple.eapolcfg_auth' 'com.apple.familycontrols')

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

Best Answer

Be careful!

Deleting the plist files and disabling them are two different things.

Those plists you mentioned in your block quote are (only imho) relatively save to disable on Sierra when SIP is disabled. SIP should probably be re-eanbled after you have finished tweaking your system.

What will be disabled is at first relatively easy to discern when just looking at the names of the culprits. But that can sometimes have quite unwelcome side-effects or unintended consequences.

These background processes are notoriously badly documented. For example: disabling AiplayXPCHelper; that seems wholly superfluous but once disabled iTunes might refuse to even start. Gaining RAM and a few cycles from disabling one process might also be offset by many status and even error messages now written into your logs because certain Apple services try to communicate with others that are presumed to be 'there' but aren't.

A good number of those processes are frankly just absolutely essential and needed for a system to run properly at all. Some can be disabled. So, yes, you can screw up your mac. That last sentence is important.

How to approach disabling features that seem unnecessary or are decidedly unwanted was described for example here.

Have I said be careful yet? You have been warned.

Document your steps. Proceed slowly. Backup even more frequently than before. Be sure you are able to retrace your steps. Keep two different backups and a bootable installer handy.

Therefore: deleting those plist files seems more thorough than just disabling them. Any space gained on disk is surely not worth it. But disabling is just so much easier to revert in case something goes wrong.

After reminding you to be careful once more: just do not delete things from /usr/libexec !