Github Action 和 fastlane p12 导入失败

发布于 2025-01-16 14:25:26 字数 1196 浏览 1 评论 0原文

我正在跟进这个 doc 使用 fastlane 进行 github 操作。 根据文档的示例,我尝试了

# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH

security import $DEV_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH

但在日志中我得到了这个

▸ 安全性:SecKeychainItemImport:导入时格式未知。

▸ 安全性:SecKeychainItemImport:导入时格式未知。

因此我收到此错误:

找不到签名证书“​​iOS Development”:没有“iOS Development” 使用私钥签署与团队 ID“XXXXXXXXX”匹配的证书 被发现了。 (在项目的目标“MyCICDAppDemo”中 'MyCICDAppDemo')

让我知道出了什么问题。

PS:在xcode中使用手动代码登录。不想尝试匹配、叹息等。

I'm following up this doc for github actions using fastlane.
As per doc's example, I tried

# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH

security import $DEV_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH

But in logs i'm getting this

▸ security: SecKeychainItemImport: Unknown format in import.

▸ security: SecKeychainItemImport: Unknown format in import.

Hence I'm getting this error:

No signing certificate "iOS Development" found: No "iOS Development"
signing certificate matching team ID "XXXXXXXXX" with a private key
was found. (in target 'MyCICDAppDemo' from project
'MyCICDAppDemo')

Let me know what is wrong.

P.S.: Using manual code signin in xcode. And not want to try with match, sigh etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水波映月 2025-01-23 14:25:26

这是我发现的问题。使用pbcopy命令复制base64字符串后,粘贴到Github秘密面板时会多出一行新行。删除多余的新行应该可以解决问题。

base64 -i CERTIFICATE.p12 | pbcopy

输入图片描述这里

Here's the gotcha I found. After coping the base64 string with the pbcopy command, there will be an extra new line when you paste it in the Github secret panel. Remove the extra new line should solve the issue.

base64 -i CERTIFICATE.p12 | pbcopy

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文