tldr-pages/tldr

update request: launchctl command usage has changed in recent macOS versions

Open

#6,362 opened on Aug 13, 2021

View on GitHub
 (3 comments) (1 reaction) (0 assignees)Shell (2,507 forks)batch import
help wanted

Repository metrics

Stars
 (30,937 stars)
PR merge metrics
 (Avg merge 7d 5h) (321 merged PRs in 30d)

Description

launchctl usage has changed in some macOS update (I'm not sure which one, either Big Sur or Catalina I think) and the old commands mostly don't work now.

Here are some examples of what does work now:

launchctl kickstart gui/501/local.phoenix.rsync-backup-prompt.plist
launchctl enable gui/501/local.phoenix.asimov-on-mount
launchctl blame gui/501/local.phoenix.rsync-backup-prompt

While these do not work anymore:

launchctl load -w ~/Library/LaunchDaemons/local.phoenix.asimov-on-mount.plist
launchctl start ~/Library/LaunchDaemons/local.phoenix.asimov-on-mount.plist

I think some commands are new (kickstart was new to me, at least). The biggest difference though is that you must provide this new kind of identifier instead of a path to the plist file.

Here's some up-to-date man pages: https://ss64.com/osx/launchctl.html

Here is the same man page at the most recent state before that change (in 2016): https://web.archive.org/web/20160413011425/http://ss64.com/osx/launchctl.html

The first part of the identifier must be one of the ones listed on that man page (gui, user, etc). The "uid" in some of those identifiers is the user'd ID number, which can be discovered with id -u (the default for a single-user computer is 501). I'm not sure about how to find the other IDs for other types of identifiers.

According to that page, the new syntax was introduced in Yosemite. Not sure the details of when the old syntax stopped working.

Contributor guide