xcodebuild 存档不断尝试使用“开发证书”即使我指定了“AdHoc Distribution”配置文件
我一直在尝试使用 xcodebuild 命令从命令行(在 Mac 机器上)构建 iOS 应用程序。
这是我用来导出存档的命令:配置
xcodebuild -project "Path/BuildOutput/XCode/Unity-iPhone.xcodeproj" -scheme "Unity-iPhone" archive -archivePath "Path/BuildOutput/XCode/Archive.xcarchive" -destination "generic/platform=iOS" -configuration Release PROVISIONING_PROFILE="xxxxxxxx-yyyyyyyy"
文件“xxxxxxxx-yyyyyyyy”在我的 Apple Developer 网站上创建为“Ad Hoc”类型配置文件,并且它使用类型为“Distribution”的证书,该证书在创建时显示作为“Apple Distribution”,
我收到以下错误:
error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "XXXXXXXXXX" with a private key was found. (in target 'Unity-iPhone' from project 'Unity-iPhone')
当我使用类型为“开发”的配置文件并且相应的证书也是“iOS 开发”类型时,不会发生该错误。看来,尽管我指定了“Ad Hoc”类型的配置文件,xcodebuild 仍然尝试查找相应的“iOS Development”类型证书,而实际证书类型不匹配。
当我进入 XCode 首选项和“管理证书”时,“Apple Distribution”证书正确显示,
我被困在这一点上,不知道该怎么办。任何帮助将不胜感激。
I have been trying to build iOS app from command line (on Mac Machine) using xcodebuild command.
Here's the command I am using to export the archive:
xcodebuild -project "Path/BuildOutput/XCode/Unity-iPhone.xcodeproj" -scheme "Unity-iPhone" archive -archivePath "Path/BuildOutput/XCode/Archive.xcarchive" -destination "generic/platform=iOS" -configuration Release PROVISIONING_PROFILE="xxxxxxxx-yyyyyyyy"
The profile "xxxxxxxx-yyyyyyyy" is created on my Apple Developer website as an "Ad Hoc" type profile, and it uses a certificate with type "Distribution", which in creation is displayed as "Apple Distribution"
I am getting the following error:
error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "XXXXXXXXXX" with a private key was found. (in target 'Unity-iPhone' from project 'Unity-iPhone')
The error does not occur when I am using a provisioning profile with type "Development" and the corresponding certificate is also "iOS Development" type. It seems that despite I specify a profile with "Ad Hoc" type, xcodebuild still tries to find a corresponding "iOS Development" type certificate while the actual certificate type does not match.
The "Apple Distribution" certificate shows up correctly when I go to XCode Preference and "Manage Certificate"
I am stuck at this point and don't know what to do. Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 Xcode 13 中遇到了同样的问题。Xcode 似乎混淆了配置文件/证书。
在 IDE 中,我注意到可以通过重新选择每个配置的配置文件(在我的例子中为 dev/QA/prod)来解决这个问题。我必须为每个配置选择错误的配置文件,然后选择正确的配置文件,然后我就会看到错误消失。 xcodebuild 工作了。
为了修复而不弄乱 Xcode,我将 CODE_SIGN_IDENTITY="iPhone Distribution" 选项添加到 xcodebuild
在您的情况下:
I experienced this same issue with Xcode 13. Xcode seems to be mixing up profiles/certs.
In the IDE, I noticed that I could fix this issue by re-selecting the provisioning profiles for each configuration (dev/QA/prod in my case). I had to select the wrong profile for each configuration, then the correct one, and I would see the error disappear. xcodebuild worked.
To fix without messing with Xcode, I added the CODE_SIGN_IDENTITY="iPhone Distribution" option to xcodebuild
In your case: