在 macOS 应用程序包中对 Automator Workflow 文件进行代码签名

Code Signing an Automator Workflow file within macOS app bundle

我正在尝试通过 Xcode Organizer 将 macOS 二进制文件上传到 Mac App Store。

我收到 "Upload failed" 错误消息:

App Store Connect Operation Error

ERROR ITMS-90276: Missing Bundle Identifier. The application bundle contains a tool or framework workflow [com.company.AppName.pkg/Payload/AppName.app/Contents/Resources/Resources/Scripts/workflow.workflow] that is missing the bundle identifier in its Info.plist file.

我的应用程序包包含 AppleScript.scptShellScript.shworkflow.workflow 个脚本文件。

什么样的脚本需要 Info.plist 和 Bundle Identifiers 来签名?我怎样才能克服这个错误?

Apple 要求所有捆绑的可执行文件都进行代码签名

What to Code Sign

You sign all the individual components of your app, leaving no gaps, including:

Nested code. First, you recursively sign all of the helpers, tools, libraries, frameworks, and other components that your app relies on, and that are bundled with your app.

https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW2

在这种情况下,workflow.workflow Automator Workflow 包的代码签名失败,因为它在其现有 Info.plist 中缺少包标识符。

我添加了以下行:

<key>CFBundleIdentifier</key>
<string>com.company.AppName.SampleWorkflow</string>

添加 BundleID 后,Xcode 组织者签名并顺利上传到 Mac App Store。