好的,这个问题相当简单。
我有一个沙盒 OSX 应用程序。
我希望用户能够编译一些 C 代码(无论他输入什么)。
但每当我尝试拨打电话时:
/usr/bin/env clang /the/path/to/the/source.c
我在日志中收到以下错误:
xcrun: error: cannot be used within an App Sandbox.
有没有any有办法规避这个吗?
附:我已经使用 Ruby、Python 和 PHP 成功地完成了几乎相同的事情。
如果您想将应用程序保留在沙箱中,您可以尝试将临时例外密钥添加到您的权利文件中:
com.apple.security.temporary-exception.files.absolute-path.read-only
更多相关信息here https://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AppSandboxTemporaryExceptionEntitlements.html
另一种实现它的方法是创建一个帮助应用程序的更麻烦的方法(XPC服务 https://developer.apple.com/library/mac/documentation/macosx/conceptual/bpsystemstartup/chapters/CreatingXPCServices.html)这不是沙盒的。还有一些关于XPC-services的细节here https://developer.apple.com/library/mac/documentation/security/conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)