Skip to content

Instantly share code, notes, and snippets.

@mcandre
Last active April 21, 2025 02:13
Show Gist options
  • Save mcandre/b8dab00d7946b596050e6e15517ca54e to your computer and use it in GitHub Desktop.
Save mcandre/b8dab00d7946b596050e6e15517ca54e to your computer and use it in GitHub Desktop.
macOS Startup Items

macOS Startup Items

macOS relies too much on applications to manage their own startup item configuration. Over time, this leads to vestigial entries building up in startup items.

Gather data on startup items

Both System Settings and launchctl stink at startup item management.

One of the key features lacking in macOS is GUI + CLI options to query startup items by the very name listed in the Login Items & Extensions pane. This overcomplicates basic cleanup operations, and makes it easier for malware to hide.

An even lower level tool than launchctl, sfltool, provides some workarounds, though even these operations are still crude.

$ sudo sfltool dumpbtm

This outputs more practical information about startup items, including the name that appears in the Login Items & Extensions pane as well as a plist name. There is a lot of output, so recommend redirecting the output to a file, and then chowning it back to a normal user account.

However, even with the plist name in hand, launchctl still stinks at disabling and removing services. And the error handling is the pits. It generates vague errors insisting the user use a completely different operation, bootout. But bootout uses a different syntax and gives few clues to resolve this.

Empty startup items list

One of the few options for cleaning up startup items is to nuke it from orbit:

$ sudo sfltool resetbtm

This removes all startup items.

That's another reason to keep a backup of the original sfltool dumpbtm list, to prime you for which programs you want to re-register as startup items.

Note that some macOS applications have buggy code, causing their CLI/GUI to fail to register themselves as startup items. As a workaround for that, manually register the relevant startup item.

Developer Notes

As a developer, please provide an automated uninstaller (.APP or .SH) in macOS application .DMG's. Or better yet, publish the application to Homebrew and the App Store.

SEE ALSO

UPDATE

Many applications forcibly re-register startup and extension entries. All is lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment