Glossary/Processes you will see

launchd

Quick answer

launchd is the first process macOS starts at boot, with process ID 1. It starts and manages the background services, agents and many other processes that run on the system and for each user.

When the Mac boots, the kernel starts launchd, and launchd starts almost everything else. It also starts services on demand, for example when an app asks for one, and restarts system services that stop unexpectedly.

In Activity Monitor you will usually see a single launchd, the one with PID 1. It normally uses very little CPU and memory.

Why launchd shows high CPU

launchd itself rarely does heavy work. When it appears busy, it is often starting processes over and over, for example a background item that crashes and gets relaunched repeatedly.

Look in Activity Monitor for a process that keeps appearing and disappearing, or check System Settings, General, Login Items to see which background items are allowed to run. Turning off a background item you do not need is a safe first step.

Why you should not quit launchd

The system launchd is the parent of the whole system. It cannot be quit in a normal way, and stopping a user launchd would end your session. Fix the process it keeps starting instead.

How to find the login item behind launchd

When launchd looks busy, the real question is what it keeps starting. Check the background items you have allowed first.

  1. Choose Apple menu > System Settings, click General in the sidebar, then click Login Items & Extensions.
  2. Look through the items that open at login and the list of apps allowed to run in the background. Anything you do not recognize or no longer use is a candidate.
  3. Turn off one item at a time and watch launchd in Activity Monitor. If its CPU drops, you have found the item.
  4. If the item belongs to an app you still use, update the app or check its own settings. If you no longer use the app, uninstall it with its own uninstaller if it has one.

How to spot a service that keeps restarting

A service that crashes and gets relaunched shows up as a process that appears in Activity Monitor for a moment, disappears, and comes back with a new PID. Sorting the CPU tab by PID, highest first, makes these easier to catch, since each relaunch gets a higher number.

In Terminal, launchctl list shows the jobs launchd has loaded for your account in three columns: the PID if the job is running, its last exit status, and its label. A dash in the first column means the job is not running right now. A negative status is the signal that stopped the job, and many Apple jobs show one because macOS stops idle services on purpose, so a nonzero status alone is not a problem.

For a label you suspect, run launchctl print gui/$(id -u)/<label>. Its output includes a runs line, the number of times launchd has started the job. If that number keeps rising every time you check, the job is in a restart loop. These commands only read information.

Where third party background items live

launchd reads job definitions from a few folders. Apple's own jobs are in /System/Library/LaunchAgents and /System/Library/LaunchDaemons, and you should leave those alone. Items installed by other apps are usually in these folders:

  • ~/Library/LaunchAgents: agents for your user account only.
  • /Library/LaunchAgents: agents for every user, installed by an administrator or an app installer.
  • /Library/LaunchDaemons: system wide daemons installed by an administrator or an app installer.

Daemons, agents and XPC services

launchd runs a few kinds of jobs, and the names show up in Activity Monitor and in launchctl output. A daemon is a system wide service with one copy for everyone on the Mac, and it does not show any interface. An agent runs separately for each user who is logged in, and it can interact with that user.

launchd also manages XPC services, small helper programs bundled inside apps and frameworks. When an app hands work to one of these, launchd starts it on demand and it appears in Activity Monitor as its own process. That is one reason processes with unfamiliar names come and go while you use an app.

Questions people ask

What is launchd on Mac?

It is the macOS service manager. It is the first process started at boot and it starts and supervises most other processes.

Why are there several launchd processes?

There is one for the system (PID 1) and additional instances for user sessions. This is normal.

Can I force quit launchd?

No. It runs the rest of the system. If it seems busy, look for a background item that keeps restarting.

Is launchd a virus?

No. launchd is part of macOS and always runs as PID 1. Malware can add its own jobs for launchd to start, which is why checking Login Items & Extensions is a good habit.

What does launchctl list show?

Each job launchd has loaded, with its PID if it is running, its last exit status, and its label. Labels usually name the company and the product, which helps you tell which app installed the job.

Is it safe to remove items from LaunchAgents?

Only for apps you recognize and no longer use, and it is better to turn the item off in Login Items & Extensions or use the app's uninstaller. Never remove anything from the folders inside `/System`.

Related

Looking for something better than Activity Monitor? See the best Activity Monitor alternatives for Mac, or browse every term in the glossary.