Mac OS应用程序,带有命令行工具的沙箱? [英] Mac OS app, sandbox with command line tool?

查看:310
本文介绍了Mac OS应用程序,带有命令行工具的沙箱?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个包含命令行工具的应用程序.我已经启用了该应用的沙箱,并对其进行了测试.我还对应用程序和命令行工具进行了代码签名.

I've made an app which includes a command-line tool. I have enabled the app's sandbox, and tested that it works. I've also code-signed both the app and the command line tool.

但是当我将应用程序上载到iTunes时,我收到一封电子邮件,告诉我未启用应用程序沙箱".

But when I upload the app to iTunes, I received a email telling me "App sandbox not enabled".

显然,我需要将键com.apple.security.app-sandbox的授权文件设置为true值,并列出可执行文件:/Contents/MacOS/myApp/contents/Frameworks/x86/myCommandLineTool.

Apparently I need to set entitlement file of key com.apple.security.app-sandbox with true value, and list the executables: /Contents/MacOS/myApp and /contents/Frameworks/x86/myCommandLineTool.

我确定我已经在Xcode中启用了沙箱,所以我认为问题出在命令行工具上.

I'm sure I've enabled sandbox in Xcode, so I thought the problem was with the command line tool.

如何为命令行工具启用沙箱?还是我应该将工具放到特定的文件夹中?欢迎提出任何建议-我已经为它困扰了几天.

How can I enable sandbox for command line tool? Or is there a specific folder I should put the tool? Any suggestions welcome - I have been troubled by it for several days.

推荐答案

我遇到了同样的问题,经过一番搜索,试用和错误,这对我有用:

I had the same issue and after some search, trial & error, this is what worked for me:

  1. 创建一个授权文件-对我来说,只是将com.apple.security.inherit设置为YES.我用xcode本身创建了这个文件.

  1. create an entitlement file - for me it was just com.apple.security.inherit set to YES. I created this file in xcode itself.

现在使用以下命令签署此命令行工具:

Now sign this commandline tool using the command:

codesign --entitlements ./entitlements.plist -s "copy & paste your certificate from keychain" ./commandlinetool   

  • 请确保使用以下命令进行检查:

  • Just to be sure, check using this command:

    codesign --display --entitlements - ./commandlinetool   
    

  • 该工具已经包含在项目中.因此,只需进行编译,存档和提交

  • This tool was already included in the project. So just compile, archive & submit

    状态现在为等待审核".

    The status is now 'waiting for review'.

    这篇关于Mac OS应用程序,带有命令行工具的沙箱?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆