I have created two cocoa applications for macOS and I am trying to open one application from another on a button click but this returns an error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" I even removed the app sandboxing in both the applications but still the same error, Any help would be appreciated.
Development Environment:
OSX: 10.14.5 (Mojave)
Xcode: 11.2.1
Swift: 4.2
Code Sample:
@IBAction func buttonAction(_ sender: Any) {
let task = Process.init()
task.launchPath = "/Users/JohnDoe/Desktop/ExampleApp.app"
task.arguments = ["--args", "hello"]
do{
try task.run()
}
catch{
print("Error: ", error)
}
task.waitUntilExit()
}