Category filter
Script to Force Close Apps on Mac
When your app gets struck on your Mac, you can force close the app and all its running processes with a single line of script from the Mac Terminal. This is an extremely useful command as it allows you to close the app without having to interact with the system GUI and also obtain diagnostic notes to assist in further troubleshooting.
Device admins can remotely run scripts on Macs managed with Hexnode using the Execute Custom Script action.
Scripting Language – Bash
File extension – .sh
Force close an app
1 2 |
#!/bin/bash killall “appname” |
Example – killall –v Notes
The killall
command is used to kill processes running on the system.
You may add the following options to the command –
-d
– Print detailed information about the matched app processes but do not kill the processes.
-v
– Show the process ID killed.
-l
– List the names of all available signals and exit. The signal TERM or terminate signal is used by default. You may use another signal by specifying with the -SIGNAL
option.