Controllig login and background items
In This post, we'll take a look at how to control login and background items on macOS.
When you start your Mac, you may have noticed that some apps or items automatically start up or appear in the background. This can be useful for apps that you use frequently, but it can also slow down your Mac or clutter your desktop.
Difference between Login Items and Background Items
- Login Items: These are apps or items that automatically start up when you log in to your Mac. They can be useful for apps that you use frequently, such as messaging apps, email clients, or productivity tools.
- Background Items: These are apps or items that run in the background when you start your Mac. They can be useful for apps that need to perform tasks in the background, such as cloud storage services, backup utilities, or system utilities.
* You can add or remove login items in the Users & Groups preferences pane in System Preferences. You can also use the sfltool
command-line tool to list, add, remove, or reset login items, this is the tool we will use in this post.
How to List Login Items
This command will list all the login items that are set to start up when you log in to your Mac.
- Open terminal
- Type
sudo sfltool dumpbtm
* Tip: Export the output to a text file, so you can read the values if you have resetted the login items.
Dump Login Items to a Text File
This can be useful if you want to save the list of login items to a text file for reference before making any changes.
- Open terminal
- Type
sudo sfltool dumpbtm > ~/Desktop.login_items.txt
- Open the file
login_items.txt
on your desktop to see the list of login items.
How to Add Login Items
Adding login items to start those apps when you log in to your Mac.
- Open terminal
- Type
sudo sfltool add --label "App Name" -a "/Applications/AppName.app"
How to Remove Login Items
Removing login items to stop those apps from starting when you log in to your Mac.
- Open terminal
- Type
sudo sfltool remove --label "App Name"
Reset Login Items
If you see a whole bunch of login items that you don't recognize or can't remove, you can reset the login items list to the default settings.
- Open terminal
- Type
sudo sfltool reset
launchctl
Command (Background Items)
You can use the launchctl
command-line tool to manage background items on macOS. Here are some useful commands:
launchctl list
- List all background items.launchctl start <label>
- Start a background item.launchctl stop <label>
- Stop a background item.launchctl remove <label>
- Remove a background item.launchctl load <path>
- Load a background item from a property list file.launchctl unload <path>
- Unload a background item from a property list file.launchctl print <label>
- Print the properties of a background item.
Items loaded by launchctl
are usually controlled by Property Lists installed in the ~/Library/LaunchAgents
folder.
Extra facts
- Background items are mostly controlled using Property Lists traditionally installed in LaunchAgents and LaunchDaemons folders.
- You can use the
launchctl
command-line tool to manage background items. - You can use the
Activity Monitor
app to see which apps are running in the background and how much system resources they are using.
Read more
- SwiftUI property wrappers • 5 minutes reading time.
- TipKit • 3 minutes reading time.
- @ViewBuilder in Swift • 4 minutes reading time.
Share
Share Mastodon Twitter LinkedIn Facebook