How to codesign and enable the hardened runtime for a 3rd-party CLI on Xcode?

Sup*_*rry 6 macos xcode objective-c codesign osx-gatekeeper

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:

在此处输入图片说明

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.

Is there a solution for this?

Sup*_*rry 9

我终于找到了解决方案。通过以下方式签名CLI:

codesign --force --options runtime --sign "Developer ID Application: COMPANYNAME" ./CLITool
Run Code Online (Sandbox Code Playgroud)

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

  • 我认为这将是“ --options runtime”。由于我以此签署了命令工具,因此它可以工作。 (3认同)