macOS Prevent Cisco AnyConnect from Automatically Start


Search for any Cisco AnyConnect related items.
% launchctl list | awk 'NR==1 || /anyconnect/'

PID	Status	Label
-	255
674	0
545	0
-	0

In macOS, when you execute the launchctl list command, it provides a list of services and agents managed by launchd, the system and service manager in macOS. This command outputs several columns of information for each item, including "PID" (Process Identifier) and "Status". Here's what they mean:

PID (Process Identifier): The PID is a unique number assigned by the operating system to each running process. This identifier is used to reference the process in various system-level operations. In the context of launchctl list, if a service or agent is currently running, its PID will be displayed in the PID column. If the service or agent is not running, you will see a "-" in this column, indicating that there is no active process associated with that item.

Status: The Status field shows the exit status of the process the last time it was run. This is particularly useful for debugging or monitoring purposes, as it can indicate whether the service or agent exited normally or with an error. A status of 0 typically means that the process exited successfully without any errors. A non-zero status indicates an error or abnormal termination, with different numbers providing insight into the nature of the error based on the specific conventions of the application or the system.
  • A positive status code usually represents a custom exit code specified by the application.
  • A negative status code often represents a signal number that caused the process to terminate. For example, -9 would indicate the process was killed with SIGKILL (signal 9).

Understanding the PID and Status can help with managing and troubleshooting services and background processes on macOS, as it provides insight into which processes are currently running and whether they've encountered any issues upon their last execution.

% launchctl list
	"LimitLoadToSessionType" = "Aqua";
	"Label" = "";
	"OnDemand" = true;
	"LastExitStatus" = 0;
	"Program" = "open";
	"ProgramArguments" = (
		"/Applications/Cisco/Cisco AnyConnect Secure Mobility";
If you find any, you can remove them using the launchctl remove <label> command, where <label> is the label of the Cisco AnyConnect item found in the list.

% launchctl unload -w /Library/LaunchAgents/

% launchctl list | awk 'NR==1 || /anyconnect/'
PID	Status	Label
-	255
-	0

% ls /Library/LaunchAgents/


Stop Cisco AnyConnect Secure Mobility Client from starting up automatically

Category: macOS Tags: public