macOS应用,沙盒化之后无法启动脚本

我添加了相应服务的xx.plist,并在shell脚本中使用launchctl load -w "$HOME/Library/LaunchAgents/com.xx.xx.plist" launchctl start com.xx.xx.local 启动,脚本名称为local,当我给app加上沙盒功能之后,我使用 let installerPath = bundle.path(forResource: "local.sh", ofType: nil) let task = Process.launchedProcess(launchPath: "/bin/bash", arguments: [installerPath!]) task.waitUntilExit()运行结果,我得到这样 的结果:Load failed: 5: Input/output error Try running launchctl bootstrap as root for richer errors. Unload failed: 5: Input/output error Try running launchctl bootout as root for richer errors. Not privileged to start service.,可以帮助我吗? 我该进行什么操作,才能让我的app正常运行?

macOS应用,沙盒化之后无法启动脚本
 
 
Q