Fastlane 构建从命令行运行,而不是从 Jenkins 运行

Fastlane build works from command line, not from Jenkins

我有一个非常简单的快速通道设置:

lane :buildonly do
  build_app scheme: "MyApp", configuration: "Release", export_xcargs: "-allowProvisioningUpdates"
end

此通道在完全无人值守的命令行上完美运行(我第一次必须输入我的凭据,但现在它记住了它们)。

[16:54:39]: Successfully exported and compressed dSYM file
[16:54:39]: Successfully exported and signed the ipa file:
[16:54:39]: /Users/jenkins/MyApp/MyApp.ipa

+------+------------------+-------------+
|           fastlane summary            |
+------+------------------+-------------+
| Step | Action           | Time (in s) |
+------+------------------+-------------+
| 1    | default_platform | 0           |
| 2    | build_app        | 594         |
+------+------------------+-------------+

[16:54:40]: fastlane.tools just saved you 10 minutes! 

我设置了一个简单的 Jenkins 作业(同一台机器,同一用户),它只是克隆我的存储库并运行脚本

bundle install
bundle exec fastlane buildonly

这很快就失败了:

[16:59:41]: ▸ === BUILD TARGET MyTarget OF PROJECT MyApp WITH CONFIGURATION Release ===
[16:59:41]: ▸ Check dependencies
[16:59:41]: ▸ Code Signing Error: No signing certificate "iOS Development" found:  No "iOS Development" signing certificate matching team ID "FFFFFFFF" with a private key was found.

我必须对我的 Jenkins 设置进行哪些更改,以便它可以看到与命令行相同的证书?

由于 Jenkins 运行 使用 launchd,我必须将 Jenkins 用户的证书从 "login" 钥匙串复制到 "System"。

感谢this问题。