How to build Sandboxed app without XCode?

笑着哭i 提交于 2019-12-05 00:43:54

问题


How to build Sandboxed app without XCode? I mean I'm using gcc Make to build my applications and own system for creating app bundles. But how can I enable the Sandbox without using XCode and option it's Sandbox option?

There's tut about Sandbox, but I can't find anywhere informations about enabling Sandbox, but still no about SB without XCode.. Anyone can help? http://developer.apple.com/library/mac/#documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxQuickStart/AppSandboxQuickStart.html#//apple_ref/doc/uid/TP40011183-CH2


回答1:


It's pretty easy to code-sign your application outside of Xcode. Simply create your entitlements in a separate plist file like this:

<?xml version="1.0" encoding="utf-8"?>
<plist version="1.0">
    <dict>
        <key>com.apple.security.app-sandbox</key>
        <true/>
    </dict>
</plist>

Once you have it, simply issue this command to code-sign your app bundle and enable sandboxing, by making it part of the entitlements:

codesign -s - -f --entitlements /path/to/entitlement.plist /path/to/YourApp.app/

If you already code-sign with a certificate, just replace '-s -' above with '-s "3rd Party Macintosh Developer..." and use your developer certificate.



来源:https://stackoverflow.com/questions/8385252/how-to-build-sandboxed-app-without-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!