I am writing a sandboxed macOS application in Objective-C / Swift. I am interested in terminating other applications programmatically. In Cocoa, there is a NSRunningApplication
class that exposes the following methods:
- (BOOL)terminate;
- (BOOL)forceTerminate;
The documentation for both methods says:
Sandboxed applications can’t use this method to terminate other applications. This method returns false when called from a sandboxed application.
I am used to cryptic documentation from apple, and I was thinking: The docs clearly say that this method cannot be used to terminate other applications if called from a sandboxed app, but from the wording, they suggest that there could be another method. Does anybody know a way to terminate an instance of NSRunningApplication
from a sandboxed app ? Many thanks for your help.