Mac app store helper tool Sandboxing

让人想犯罪 __ 提交于 2019-12-04 15:13:00

You need to sign both main app and helper console tool

Signing .app is documented so I describe you how to codesign the helper.

  • Create by hand an entitlements file and add it to helper project (you can copy the one from main app and removing not necessary entitlements keys)
  • Create an Info.plist as documented at Adding an Info.plist to Single-File Tools (this step should be not mandatory but if you find the helper crash try to add it)

If main app launches the helper tool you should need to add

com.apple.security.inherit

this is described in Enabling App Sandbox Inheritance

If main app interacts with helper in some other manner maybe you need XPC communication or if you are lucky it will be sufficient to use App Group

Something like

<key>com.apple.security.application-groups</key>
<array>
    <string>$(TeamIdentifierPrefix)my.package</string>
</array>

Take a look at AppSandboxLoginItemXPCDemo

From my experience TeamIdentifierPrefix must be empty on development environment and set to your team id when you submit to MAS, please handle with care my considerations on TeamIdentifierPrefix (i.e. try yourself)

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