Search code examples
swiftmacossandboxappstore-sandbox

Unable to terminate other apps when sandbox


I developed an app that terminates other apps, It works perfectly when it's not sandboxed.

NSWorkspace.shared.runningApplication.forceTerminate()

Issue: When the app is sandbox I cannot terminate other apps.

Question: How can allow my app to have the capability to terminate other apps when sandbox?


Solution

  • When the app is sandbox I cannot terminate other apps.

    Correct. That is the essence of the sandbox: your application is isolated from other applications, and cannot interact with them outside of certain specific channels.

    How can allow my app to have the capability to terminate other apps when sandbox?

    You can't. (At least, not in the general case.)