如何对Xcode上的第三方CLI进行签名并启用强化的运行时? [英] How to codesign and enable the hardened runtime for a 3rd-party CLI on Xcode?

查看:296
本文介绍了如何对Xcode上的第三方CLI进行签名并启用强化的运行时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目需要Ghostscript来完成许多任务,因此我将gs CLI工具添加到了我的项目资源中.但是,当我尝试对项目应用程序进行公证时,Xcode会向我显示以下内容:

My project needs the Ghostscript to do lots of tasks, so I have added the gs CLI tool into my project resource. However when I tried to notarize the project application, Xcode shows me this:

我认为这可能是因为ghostscript便携式CLI是Internet上的第三方程序,并且没有代码,也未启用强化的运行时.在最新的MacOS Mojave上,我必须对应用程序进行公证,以避免在用户打开DMG文件时网守显示警告.但是,如果应用程序包含第3方CLI,则似乎很难通过公证.

I assume that might because the ghostscript portable CLI is a 3rd-party program from the internet and which doesn't have a codesign, also it has not been enabled the hardened runtime. On the latest MacOS Mojave I have to notarize applications to avoid the gatekeeper shows warnings during the user opens the DMG file. But it seems the notarizing is hard to pass if the application contains a 3rd-party CLI.

有解决方案吗?

推荐答案

我终于找到了解决方案.通过以下方式对CLI进行签名:

I found the solution finally. Sign the CLI this way:

codesign --force --options runtime --sign "Developer ID Application: COMPANYNAME" ./CLITool

然后我成功地将应用程序存档并上传到Apple进行公证.

Then I successfully archived the Application and uploaded to Apple to notarize.

这篇关于如何对Xcode上的第三方CLI进行签名并启用强化的运行时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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