【问题标题】:Command line build ipa - no profiles found命令行构建 ipa - 未找到配置文件
【发布时间】:2019-05-24 00:00:55
【问题描述】:

一段时间以来,我一直在使用命令行步骤来创建我的 iOS 应用程序 ipa。我一直害怕将我的构建系统操作系统更新到 High Sierra,因为过去每次操作系统更新以及更新的 xCode 都会破坏通过命令行自动构建的所有内容。

现在我在 High Sierra 上并使用 xCode 9.4.1,我似乎无法根据存档生成 .ipa。

以下命令是我用来生成存档的:

xcodebuild -project Unity-iPhone.xcodeproj -scheme Unity-iPhone -configuration Release clean archive -archivePath ./build/archive DEVELOPMENT_TEAM=<TEAM_ID>

这会输出一个 archive.xcarchive 文件,然后我将对其执行以下命令:

xcodebuild -exportArchive -archivePath ./build/archive.xcarchive -exportOptionsPlist ./iOS_ExportOptions_DEV.plist -exportPath ./build/adhoc -allowProvisioningUpdates

运行此命令将失败并出现此错误:

2018-06-27 11:19:59.789 xcodebuild[27042:735265] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/Unity-iPhone_2018-06-27_11-19-59.788.xcdistributionlogs'.
2018-06-27 11:20:21.364 xcodebuild[27042:735265] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7f9582c35d20>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
    "Error Domain=IDEProvisioningErrorDomain Code=23 \"There are no accounts registered with Xcode.\" UserInfo={NSLocalizedDescription=There are no accounts registered with Xcode., NSLocalizedRecoverySuggestion=Add your developer account to Xcode}",
    "Error Domain=IDEProfileLocatorErrorDomain Code=1 \"No profiles for 'com.MY.BUNDLE' were found\" UserInfo={NSLocalizedDescription=No profiles for 'com.MY.BUNDLE' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store provisioning profiles matching 'com.MY.BUNDLE'.}"
)}
error: exportArchive: There are no accounts registered with Xcode.

Error Domain=IDEProvisioningErrorDomain Code=23 "There are no accounts registered with Xcode." UserInfo={NSLocalizedDescription=There are no accounts registered with Xcode., NSLocalizedRecoverySuggestion=Add your developer account to Xcode}

error: exportArchive: No profiles for 'com.MY.BUNDLE' were found

Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for 'com.MY.BUNDLE' were found" UserInfo={NSLocalizedDescription=No profiles for 'com.MY.BUNDLE' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store provisioning profiles matching 'com.MY.BUNDLE'.}

** EXPORT FAILED **

再次使用此命令获取存档并导出在 Sierra 中运行 xCode 9.1 的 ipa。所有规定都在机器上以及所需的开发人员证书上。此外,我在 xCode 中使用我的开发人员帐户登录。所有这一切的最大烦恼是,我能够手动存档和创建 ipa,我可以直接在 xCode 中提交给 itunes connect 并且一切正常。

最后是我的 iOS_ExportOptions_DEV.plist 文件:

    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>ad-hoc</string>
    <key>teamID</key>
    <string>TEAM ID</string>
</dict>
</plist>

如果有人遇到此问题,请告诉我您是如何解决的。

【问题讨论】:

  • 我也有同样的问题。我在 Xcode 上登录,我可以从 Xcode 构建和存档。如果我从命令行运行构建,我可以构建和创建 .xcarchive,但我无法导出到 .ipa 文件。我收到错误消息“您的帐户无权创建 iOS In House 配置文件。”

标签: ios xcode command-line macos-high-sierra


【解决方案1】:

现在我在 Xcode 10.2.1 中使用 Mojave,我也遇到了同样的问题,最后我解决了在 .plist 文件中测试不同的键标签组合的问题。

在阅读apple developer documentation 中的 .plist 文件标签后,我会生成一个 .plist 文件,其中包含您的标签以及来自其他答案 https://stackoverflow.com/a/35063904/11135813 的几乎所有标签(只有我需要的关键标签)。

问题出在关键方法值上。如果包含它,它应该带有&lt;string&gt;development&lt;/string&gt; 值(如果您不包含这些标签,则为默认值)。如果您包含任何其他允许的值{app-store, ad-hoc, enterprise, validation},您需要确保您的 Apple ID 帐户被允许执行导出操作。检查添加到您的环境中的开发 Xcode 帐户,并向您的证书管理员团队询问您帐户的管理员角色。稍后也需要此角色来验证您的 IPA 文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-30
    • 2013-05-15
    • 2012-01-21
    • 2012-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多