我有一个非沙盒式macOS应用程序,它使用以下方法愉快地调用其资源包中的Shell脚本:
class func runShell(launchPath: String, arguments: [String] = [], waitUntilExit: Bool) -> Void {
let task = Process()
task.launchPath = launchPath
task.arguments = arguments
let pipe = Pipe()
task.standardOutput = pipe
task.launch()
if waitUntilExit {
task.waitUntilExit()
}
}
ABCProcessManager.runShell(launchPath: scriptPath.path, arguments: ["-workingdirectory", path], waitUntilExit: true)
我正在尝试将应用程序转换为沙盒应用程序(用于App Store上传),但是在调用脚本时会冻结。
这些脚本管理启动代理。加载,卸载,启动,停止。
我需要如何更改代码以使其在打开沙箱的情况下起作用?也许有一种管理启动代理的“沙盒方式”?