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 view
In recent versions of macOS you can use the launchctl print
command. You have to know which domain it's running under, e.g. system
or gui/
. There are a few other domains you can find in the man page, but so far I have only seen services running under these two. Examples:
% launchctl print gui/$(id -u)/com.apple.cloudphotod | grep path
path = /System/Library/LaunchAgents/com.apple.cloudphotod.plist
% launchctl print system/com.openssh.sshd | grep path
path = /System/Library/LaunchDaemons/ssh.plist
stderr path = /dev/null
I believe this command was implemented in High Sierra or thereabouts.