If it's not in "Login Items" then it has to be in launchctl
. Always prefer the user interface when there is one rather than messing with files directly:
launchctl list | grep -i cisco
launchctl unload -w /Library/LaunchAgents/com.cisco.anyconnect.gui.plist
launchctl list | grep -i cisco
# Load it back
launchctl load -w /Library/LaunchAgents/com.cisco.anyconnect.gui.plist
launchctl list | grep -i cisco
NB: be careful NOT to run sudo launchctl
and NOT to run launchctl
from a root terminal, because launchctl is user-dependent. For example, trying to run sudo launchctl unload -w /Library/LaunchAgents/com.cisco.anyconnect.gui.plist
results in an error "Could not find specified service", whereas without the sudo
it works.
When there's a user interface it's very likely because it does more than just moving one file. Don't take the risk to miss those extra bits; use the official and documented user interface.
launchctl
is the equivalent of systemd
on Linux or services.msc
on Windows. Every mac user should have at least some vague idea of what launchctl
does because it manages far more than AnyConnect: basically every process not manually started by the user.
launchctl
is documented in (surprise) man launchctl
but that's not for the faint of heart. For a friendlier documentation that does not assume you already know the difference between "loading" versus "starting" or between a "daemon" vs a "service" or an "agent" go to http://www.launchd.info/ first.
As a bonus and slightly off-topic answer, here's a clean way to restart the AnyConnect daemon in case it gets stuck as it sometimes does. This is the other, lower-level AnyConnect process(es) without any user interface and running as root that does the actual work:
sudo launchctl kickstart -kp system/com.cisco.anyconnect.vpnagentd
Avoid kill
and killall
, see why on http://www.launchd.info/
Be careful where you use sudo
since some of the agents and daemons run in user space and some run in system space and different versions of macOS have different syntax and shells.