I need the proper format for adding an application ID to an entitlements file (developing outside of Xcode)

Adding application ID to .pkg file seemed to work

Original

<?xml version="1.0" encoding="utf-8"?> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.files.user-selected.read-write</key> <true/> </dict> </plist>

My modified version

<?xml version="1.0" encoding="utf-8"?> <plist version="1.0"> <key>com.apple.application-identifier</key> <1234567890.com.My.App/> <key>com.apple.developer.team-identifier</key> <com.My.app/> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.files.user-selected.read-write</key> <true/> </dict> </plist>

I created a .pkg file which installed to Applications folder and the app worked fine, but when I uploaded the app with transporter I got the message 'executables must include the "com.apple.security.app-sandbox" entitlement with a Boolean value of true'

Answered by DTS Engineer in 888620022

I presume you’ve read TestFlight, Provisioning Profiles, and the Mac App Store. If not, please do so now.

As to what’s going wrong, it’s hard to say because I’m not confident that the XML snippets you posted survived the trip into DevForums. In future, I recommend that you put them in a code block. See tip 3 in Quinn’s Top Ten DevForums Tips.

Having said that, there’s an easy way to see what this file should look like:

  1. Create a dummy Xcode project with the same bundle ID as your app.
  2. Make sure that automatic code signing is enabled.
  3. Add some restricted entitlement to the app. See TestFlight, Provisioning Profiles, and the Mac App Store for more about that.
  4. Build the app.
  5. Dump its entitlements:
% codesign -d --entitlements - --xml /path/to/your.app

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I presume you’ve read TestFlight, Provisioning Profiles, and the Mac App Store. If not, please do so now.

As to what’s going wrong, it’s hard to say because I’m not confident that the XML snippets you posted survived the trip into DevForums. In future, I recommend that you put them in a code block. See tip 3 in Quinn’s Top Ten DevForums Tips.

Having said that, there’s an easy way to see what this file should look like:

  1. Create a dummy Xcode project with the same bundle ID as your app.
  2. Make sure that automatic code signing is enabled.
  3. Add some restricted entitlement to the app. See TestFlight, Provisioning Profiles, and the Mac App Store for more about that.
  4. Build the app.
  5. Dump its entitlements:
% codesign -d --entitlements - --xml /path/to/your.app

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

So I put the entitlements you suggested in your other post, "TestFlight,` Provisioning Profiles, and the Mac App Store" in the <dict></dict> tags.


<?xml version="1.0" encoding="utf-8"?>
<plist version="1.0">
    <dict>

        <key>com.apple.security.app-sandbox</key>
        <true/>
        <key>com.apple.security.network.client</key>
        <true/>
        <key>com.apple.security.files.user-selected.read-write</key>
        <true/>
        <key>com.apple.application-identifier</key><string>1234567890.MyApp</string>
        <key>com.apple.developer.team-identifier</key>
        <string>1234567890</string>
    </dict>
</plist>

 I can now verity the .pkg file with Transporter and upload to App Store Connect but installing to the Applications folder does not work.

 I am making an Adobe AIR app so I may need to treat the UNIX executable included in the .app file as an embedded file.
I can now verity the .pkg file with Transporter and upload to App Store Connect

Cool.

but installing to the Applications folder does not work.

Installing how? By opening the .pkg with the Installer? That’s not expected to work. In general, you can’t test distribution signed code like this. Rather, upload your app to the App Store and then test it with TestFlight.

For more backstory, see Don’t Run App Store Distribution-Signed Code.

I am making an Adobe AIR app so I may need to treat the UNIX executable included in the .app file as an embedded file.

I’m not sure I understand what you’re getting at here. If you’re publishing on the Mac App Store then your app must be an app. That is, the user must be able to launch it by double clicking it in the Finder. This means that MyApp.app/Contents/MacOS/MyApp must be an executable that present a GUI.

If you want to bundle other executables within your app that’s fine, but there are some rules to follow. See Placing content in a bundle for advice about placement. Also, any executable that you spawn as a child process will inherit your app’s sandbox and it must be marked as such so that the App Store knows this. If you were using Xcode then you could follow the advice in Embedding a command-line tool in a sandboxed app. However, you’re not using Xcode so you’ll either have to:

  • Read our documentation and figure out how to replicate the effect with yoru tools.
  • Seek help from your third-party tooling vendor.

Or both (-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I need the proper format for adding an application ID to an entitlements file (developing outside of Xcode)
 
 
Q