I'm using this function below under a button to relaunch the application.
func relaunchApp() {
let url = URL(fileURLWithPath: Bundle.main.resourcePath!)
let path = url.deletingLastPathComponent().deletingLastPathComponent().absoluteString
let task = Process()
task.launchPath = "/usr/bin/open"
task.arguments = [path]
task.launch()
exit(0) }
This works perfectly on my Macbook Air 2015 model. However, when I send this file to anybody else with the exact same model (or a Mac Mini I've also tried this on), nothing happens after the button is pressed. This is under both conditions of being completely compiled and just doing a run from Xcode, either work on my side. How can I solve this issue?