When you turn on your Mac, various apps, add-ons, and background processes run automatically. Most of them are needed by users, but sometimes I need to make sure that what I added myself is correct. In particular, these items can increase the time it takes to start up and degrade the performance of your Mac, so make sure to load only what you need. Let’s see how to manage various startup and login items.
If you open ‘System Preferences’, click ‘Users & Groups’, and then click ‘Login Items’, you can see a list of apps that run every time you log in. Sometimes files or folders are included. This list is different for each user account. You can usually manage items here. Because the app is added here. Most apps ask for permission to ‘Open at login’ the first time they run, or put a ‘Open at login’ or similar checkbox in the settings. In any case, you can add an item using the’+’ button in this ‘login item’ menu, or delete it with the’-‘ button after selecting it.
Early versions of macOS used two folders to handle items to load when the Mac starts up. These are /Library/StartupItems and /System/Library/StartupItems. We don’t currently recommend using these folders, but some older apps still do it. In general, the /System/Library/StartupItems folder should be empty. However, if the folder contains items you no longer use, you should move them to the trash so they don’t run automatically when you start your Mac.
Running daemons and agents
Since OS 10.4 Tiger, Apple has added a new mechanism for developers to auto-run items. Daemons and agents controlled by the launch process. It’s a way to give developers more flexibility, but it’s also a way to make users less transparent.
Instead of launching the app directly, launched loads a separate format, .plist document. This document stipulates which apps should be run under what circumstances. These items are always executed in the background, executed at a specific cycle, and sometimes terminated after execution only when an event that changes a specific file or folder occurs. This .plist file used by launched can occupy 5 folders, and the specific folder is determined by when the item is executed and with what permission.
- Items in the /Library/LaunchDaemons, /System/Library/LaunchDaemons folders are run with root user privileges when starting the Mac.
- Items in the /Library/LaunchAgents, /System/Library/LaunchAgents folders are executed with user privileges when all users log in.
- Items in the /Users/(user name)/Library/LaunchAgents folder are executed with user privileges only when a specific user logs in.
Note that you shouldn’t change system files. For example, two of these five folders are located under the /System folder. Specifically, they are /System/Library/LaunchDaemons and /System/Library/LaunchAgents. These two folders are for components that contain parts of macOS. You might want to delete or change it, but it’s a key folder to keep your Mac running normally, so don’t touch it.
Other folders can be changed as desired. You can go to these folders to see what files are there, disable them, or change how often they run. However, you need to understand exactly how these items work before making any modifications.
When you start up or log in to your Mac, startup items stored in these folders are loaded. This is an item registered in the system and is executed unless the deactivation flag is set. After that, the command is executed until the system is restarted. Even if you move the startup item to the trash, it continues to run until you reboot. To see all the startup items currently running on your Mac, open a terminal in Applications> Utilities, type launched list, and hit enter.
To stop a currently running startup item without restarting the system, open a terminal and type launchctl unload, and enter the full path to the startup item. For example:
launchctl unload ~/Library/LaunchAgents/com.apple.FolderActions.enabled.plist
Running this unloads the startup agent that activates the AppleScript folder action. To return it to its original state, simply execute unload in a terminal window by changing the load command. For reference, if it is difficult to enter the full path during this process, there is an easier way. Just drag the item to the terminal window.
Most of the startup items run on a specific cycle or only when needed and are automatically disabled, so having an item in a folder doesn’t mean it’s currently running. To see what’s currently running, just open the Applications> Utilities> Show Activity app. However, keep in mind that the process name shown here may be different from the name you tell macOS to run in the .plist file.
The identity of a process with an unknown name
So far, we’ve seen the most common ways to automatically launch apps on macOS. But this is not the only one. If you see an unknown process, it’s probably one of the following:
- Kernel extensions : These are called kernel extensions or kexts. They are stored in /System/Library/Extensions and are loaded when you turn on the Mac. They provide low-level features such as audio processing and peripheral support, and most of them work as part of macOS. The safest way to remove only third-party casks is to use the uninstaller provided by the developer.
- Cron : Cron is a Unix scheduling utility built into macOS. It’s not as widely used as launchd anymore, but it’s not easy to see exactly what’s still left on the Mac. It may be necessary to run old software.
- Log scripts : Log scripts were used in older versions of macOS as startup items. Not used anymore.