【问题标题】:xcodebuild cannot find correct iOS Development Certificate under cronxcodebuild 在 cron 下找不到正确的 iOS 开发证书
【发布时间】:2018-12-03 08:53:09
【问题描述】:

我目前正在使用 xcodebuild 命令行工具来构建应用程序并将其部署到 iPhone,如下所示。

我在我的登录钥匙串中看到 iOS 开发证书确实存在,但密钥与 Key1 不匹配,如输出所示。我的问题是如何让 xcodebuild 选择当前在钥匙串中的正确 iOS 开发证书。

构建命令

HOME=/Users/mcj xcodebuild build-for-testing -project ios/ios_test_app/HXKPIIOS/HXKPIIOS.xcodeproj -scheme HXKPIIOS -destination 'platform=iOS,id=<iPhoneUDID>' -derivedDataPath /opt/HX/HXKPI_Logs/kpi18_iOS_2018-06-23-21-20-01-149882/<iPhoneUDID>/build_derived_data | tee /opt/HX/HXKPI_Logs/kpi18_iOS_2018-06-23-21-20-01-149882/<iPhone UDID>/uitest/build1.log

输出

User defaults from command line:
    IDEDerivedDataPathOverride = /opt/HX/HXKPI_Logs/kpi18_iOS_2018-06-23-21-20-01-149882/<iPhoneUDID>/build_derived_data

=== BUILD TARGET HXKPIIOS OF PROJECT HXKPIIOS WITH CONFIGURATION Debug ===

Check dependencies
Code Signing Error: No signing certificate "iOS Development" found:  No "iOS Development" signing certificate matching team ID "<Key1>" with a private key was found.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.2'

【问题讨论】:

    标签: ios xcode cron certificate xcodebuild


    【解决方案1】:

    转到项目导航器>>“常规”选项卡。查找“签名”部分,您将看到您的团队、配置文件、签名证书和您的签名状态。您的状态可能存在问题,因为您无法使用您的帐户登录。在这种情况下,只需按登录...并重新输入您的凭据。或者,也许,您登录的团队没有您的 Signing。在这种情况下,请转到“团队”部分并简单地更改您登录的团队。最后,在签名部分检查您的签名证书。如果它为空,这就是 Xcode 无法识别您的证书的原因。

    【讨论】:

    • 检查了我的一般 -> 签名它说“自动管理签名”已选中,并且团队按预期选择。如果您阅读了我的问题,您就会知道,当我尝试通过终端手动运行它时,提到的 Build 命令确实可以正常工作,因为它可以在登录钥匙串下找到正确的证书,但在 cron 下运行时找不到正确的证书。我认为原因可能是在 cron 下找不到登录钥匙串。我还尝试在系统钥匙串下复制粘贴 iOS 开发证书,但错误仍然存​​在。
    猜你喜欢
    • 2013-06-04
    • 2013-01-05
    • 1970-01-01
    • 2015-08-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-02
    • 2013-06-02
    • 2019-08-16
    相关资源
    最近更新 更多