Is it possible to know the .plist file location which is loaded into the launchctl command?
The label name is listed with "launchctl list" and its contents can be viewed by "launchctl list LABEL", but I cannot find the .plist file location.
I know it will be located in /Library/LaunchAgent or ~/Library/LaunchAgent or something, but I don't want to search around paths while all jobs is listed with the launchctl command.
Go to Applications > Utilities and launch Activity Monitor. Click the CPU column header to order tasks by the CPU cycles. If you can't see launchd, that's a good sign as it's near the list's bottom. If you want to see it, search for it in the search bar.
The launchd process is used by macOS to manage daemons and agents, and you can use it to run your shell scripts. You don't interact with launchd directly; instead you use the launchctl command to load or unload launchd daemons and agents.
Mac LaunchAgents start when a user logs in. Unlike daemons, they can access the user interface and display information. For example, a calendar app can monitor the user's calendar account for events and notify you when the event occurs.
Using a launch daemon is another privilege escalation method applicable to Apple-based operating systems, especially OS X. When OS X boots up, launchd is normally run to end system initialization.
As of macOS 10.12.6 (not sure about earlier versions) it is possible to invoke: launchctl dumpstate
and you will get a wealth of information about all running processes
Look for <LABEL> = {
as the first line of info pertaining to that job
Here's a one liner to get all the active daemons and their plist paths:
grep -B 1 -A 4 "active count = 1$" <<< "$(launchctl dumpstate)"
Update: Since 10.12 macOS has added other values so the grep -A n
has been increased to 4 lines
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With