Consider the following commands

# launchctl stop 
Usage: launchctl stop <service-name>
# launchctl stop com.apple.SomeService
# launchctl disable com.apple.SomeService
Usage: launchctl disable <service-target>

What is the difference between a service-target and a service-name? How can I learn a service-target of a service from it's service-name?


A service target is a service name plus a target domain, which describes the context in which the service runs, e.g. whether it runs at system startup or when a particular user logs in etc.

The launchctl(1) manpage describes 6 ways of forming a service target from a service name. If you want to disable a service that runs at startup, you probably want one of these three depending on whether it's a service that runs at system startup or when you log in:

    Targets the system domain or a service within the system domain. The system
    domain manages the root Mach bootstrap and is considered a privileged execu-
    tion context. Anyone may read or query the system domain, but root privi-
    leges are required to make modifications.

    Targets the user domain for the given UID or a service within that domain. A
    user domain may exist independently of a logged-in user. User domains do not
    exist on iOS.

    Another form of the login specifier. Rather than specifying a user-login
    domain by its ASID, this specifier targets the domain based on which user it
    is associated with and is generally more convenient.

You can find out the uid number for your user account like this:

$ id -u [your-username]
  • 33
    Is there a way to go from the service "label" or PID displayed by launchchtl list to the "service-target" without trying all of these possible domains? – algal Dec 9 '15 at 22:39
  • use gui/<PID>/<service-name> instead of user/<PID>/<service-name> – clearloop Sep 22 '20 at 16:20
  • if you want to view the services associated with the pid, from launchctl list, use launchctl print pid/<pid> Fails sometimes with Could not print domain: 1: Operation not permitted. – chiggsy Jan 11 at 18:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .