How to create a sandboxed application without Xcode?

How to create a sandboxed application without Xcode? I mean, I use gcc Make to build my applications and my own system to build application packages. But how can I turn on the Sandbox without using Xcode and choose the Sandbox option?

There is a sandbox there, but I can not find anywhere information on enabling Sandbox, but still not about SB without Xcode. Can anybody help? http://developer.apple.com/library/mac/#documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxQuickStart/AppSandboxQuickStart.html#//apple_ref/doc/uid/TP40011183-CH2

+6
source share
1 answer

It is very easy to sign application code outside of Xcode. Just create your rights in a separate plist file as follows:

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

Once you do this, simply run this command to sign the code of your application package and enable the sandbox, making it part of the rights:

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

If you already signed the code with the certificate, simply replace the "-s" above with the "-s" of a third-party Macintosh developer ... "and use the developer certificate.

+8
source

Source: https://habr.com/ru/post/903103/


All Articles