我目前正在使用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'
答案 0 :(得分:0)
转到项目浏览器>>“常规”选项卡。查找“签名”部分,您将看到您的团队,配置文件,签名证书和签名状态。您可能无法登录自己的帐户,因此状态可能有问题。在这种情况下,只需按登录...,然后重新输入您的凭据即可。或者,也许您是在没有签名的团队中登录的。在这种情况下,转到“团队”部分,只需更改您登录的团队即可。最后,在“签名”部分中检查您的签名证书。如果它为空,这就是Xcode无法识别您的证书的原因。