Cocoa:启动另一个应用程序的沙盒权利
我正在从我的沙盒应用程序调用
[[NSWorkspace sharedWorkspace] launchApplication:path];
,并且在控制台中收到此错误:
9/5/11 12:23:12.462 PM lsboxd:拒绝生成
路径已编辑>对于 21383 - 原因 -10826
2011 年 9 月 5 日 12:23:12.463 PM 应用程序:spawn_via_launchd() 失败,errno=54 label=[0x0-0x1994993].MYApp path=<路径已编辑>标志=0
2011 年 9 月 5 日 12:23:12.464 PM 应用程序:LSOpenFromURLSpec() 返回 -10810,应用程序 <<路径已编辑> (空)。
换句话说,我显然被“启动服务沙箱守护进程”(lsboxd) 阻止,它认为应用程序 1 不应该启动应用程序 2。
根据记录,10826 是“用户无权启动应用程序” ”,然后 10810 是“发生未知错误”
有人知道这种情况的权利吗?
如何从沙盒应用程序启动其他应用程序(请不要说 AppleScript - 这是一场无法正常运行的噩梦,尤其是从沙盒应用程序或 XPC 服务调用时)。理想的方法是在沙箱中使用(严重受损的)NSWorkspace。
I'm calling
[[NSWorkspace sharedWorkspace] launchApplication:path];
From my sandboxed app, and I'm getting this error in the console:
9/5/11 12:23:12.462 PM lsboxd: refusing to spawn < PATH REDACTED > for 21383 - reason -10826
9/5/11 12:23:12.463 PM App: spawn_via_launchd() failed, errno=54 label=[0x0-0x1994993].MYApp path=< PATH REDACTED > flags=0
9/5/11 12:23:12.464 PM App: LSOpenFromURLSpec() returned -10810 for application < PATH REDACTED > (null).
In other words, I'm clearly getting blocked by the "Launch Services Sandbox Daemon" (lsboxd) which doesn't think app 1 should be launching app 2.
For the record 10826 is "The user does not have permission to launch the application" and then 10810 is "An unknown error has occurred"
Does anyone know of an entitlement for this case?
How can you launch other apps from a sandboxed app (please don't say AppleScript - it's a non-functioning nightmare, especially when called from sandboxed apps or XPC services). The ideal is a way to use the (severely crippled) NSWorkspace from within a sandbox.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
launchApplication:
的参数是应用程序的名称(即类似@"Safari"
),而不是其路径。这样,它就可以在我没有任何特殊权利的情况下工作。我不认为您可以在不使用 PowerBox 的情况下从沙盒应用程序在任意路径启动应用程序。The parameter of
launchApplication:
is the application's name (i.e. something like@"Safari"
), not its path. That way, it's been working without any special entitlements for me. I don't think you can launch apps at arbitrary paths from a sandboxed app without using PowerBox.