ios - 即使我指定了 "Development Certificate"配置文件,xcodebuild 存档仍然尝试使用 "AdHoc Distribution"

标签 ios xcodebuild adhoc apple-developer

我一直在尝试使用 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 开发者网站上创建为“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”证书正确显示

我现在陷入困境,不知道该怎么办。任何帮助将不胜感激。

最佳答案

我在 Xcode 13 中遇到了同样的问题。Xcode 似乎混淆了配置文件/证书。

在 IDE 中,我注意到可以通过重新选择每个配置的配置文件(在我的例子中为 dev/QA/prod)来解决这个问题。我必须为每个配置选择错误的配置文件,然后选择正确的配置文件,然后我就会看到错误消失。 xcodebuild 工作了。

为了在不干扰 Xcode 的情况下进行修复,我向 xcodebuild 添加了 CODE_SIGN_IDENTITY="iPhone Distribution"选项

就您而言:

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" CODE_SIGN_IDENTITY="iPhone Distribution"

关于ios - 即使我指定了 "Development Certificate"配置文件,xcodebuild 存档仍然尝试使用 "AdHoc Distribution",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71404609/

相关文章:

ios - 如何让这些方法适用于多点触控?

IOS应用程序在正常工作几个月后无法安装

ios - 使用 Alamofire 在 Swift 中下载和解析 json

swift - Xcode 8.2,Swift 编译器错误 : error: unexpected input file

ios - Xcode 5 xcodebuild 单元测试似乎在测试失败时返回状态成功

ios - xcodebuild exportArcive- 从命令行导出时如何自定义默认 IPA 文件名?

ios - 在 UDID 禁令之后制作自定义 "AdHoc Helper App"...?

c++ - Ad-Hoc网络控制

iphone - Xcode 4 无法表示崩溃日志

iphone - 使用什么,用于xcode的GDB或LLDB调试器