Xcode 9 分发版构建失败,因为新版本中 exportOptions.plist 的格式已更改
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45748140/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 9 distribution build fails because format of exportOptions.plist has changed in new release
提问by tutiplain
I am trying to compile an ad-hoc IPA for my app using SDK version 6.1.2 and Xcode 9 beta (trying to see if the app works in the new version). My build is failing with the following error message:
我正在尝试使用 SDK 版本 6.1.2 和 Xcode 9 beta 为我的应用程序编译一个临时 IPA(尝试查看该应用程序是否在新版本中工作)。我的构建失败并显示以下错误消息:
Error Domain=IDEProvisioningErrorDomain Code=9 ""DGHospice.app"
requires a provisioning profile." UserInfo=
{NSLocalizedDescription="DGHospice.app" requires a provisioning
profile., NSLocalizedRecoverySuggestion=Add a profile to the
"provisioningProfiles" dictionary in your Export Options property
list.}
The Distribution Profile is valid and I can create an IPA if I use iOS SDK 10. Build only fails in 11.0. Can someone help me pinpoint the issue?
分发配置文件是有效的,如果我使用 iOS SDK 10,我可以创建一个 IPA。构建仅在 11.0 中失败。有人可以帮我查明问题吗?
回答by ablarg
It appears you using manual code signing (deduced by the Export Options property list
in your error message). You should probably switch to automatic code signing as recommended by Apple if it suits your needs.
看来您使用的是手动代码签名(由Export Options property list
错误消息中的推断)。如果适合您的需要,您可能应该按照 Apple 的建议切换到自动代码签名。
The problem appears to be that exportOptions.plist format is not compatible with Xcode 9
. A bare bones distribution plist for Xcode 9
now looks similar to this:
问题似乎是 exportOptions.plist 格式与Xcode 9
. 现在的裸骨分布 plistXcode 9
看起来类似于:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>provisioningProfiles</key>
<dict>
<key>MY_APP_BUNDLE_ID</key>
<string>MY_PROFILE_NAME_AS_SHOWN_BY_XCODE or UUID_FOUND_IN_MOBILEPROVISION_FILE</string>
</dict>
<key>signingCertificate</key>
<string>iOS Distribution</string>
<key>signingStyle</key>
<string>manual</string>
<key>teamID</key>
<string>MY_TEAM_ID</string>
</dict>
</plist>
You can see the list of supported options for the exportOptions.plist
by running xcodebuild -help
.
您可以exportOptions.plist
通过运行查看支持的选项列表xcodebuild -help
。
You can get a useful overview of how this stuff works in Xcode 9
by watching this video:
https://developer.apple.com/videos/play/wwdc2017/403/
Xcode 9
通过观看以下视频,您可以对这些东西的工作原理有一个有用的概述:https:
//developer.apple.com/videos/play/wwdc2017/403/
You can also get help by searching for 'Manual Signing' in Xcode's search field.
您还可以通过在 Xcode 的搜索字段中搜索“手动签名”来获得帮助。
You can create a dummy exportOptions.plist
file by following the process documented here by Anna Bátki at BitRise:
http://blog.bitrise.io/2017/08/15/new-export-options-plist-in-Xcode-9.html
您可以exportOptions.plist
按照 Anna Bátki 在 BitRise 记录的过程创建一个虚拟文件:http://blog.bitrise.io/2017/08/15/new-export-options-plist-in-Xcode-9.html
You should be aware that if you follow Anna's steps using Xcode 9 beta 5
, the exportOptionsPlist
will not be exported. This behavior works again in Xcode 9 GM
.
您应该知道,如果您按照 Anna 的步骤使用Xcode 9 beta 5
,exportOptionsPlist
则不会导出。这种行为在Xcode 9 GM
.
To determine what the value of your provisioning profile s in the exportOptionsPlist
file, you can view the contents of the .mobileprovision file you wish to use and set the key to your application's bundle id ('com.foo') and the value to the UUID of in your .mobileprovision file.
要确定您的配置文件在exportOptionsPlist
文件中的值,您可以查看您希望使用的 .mobileprovision 文件的内容,并将密钥设置为应用程序的包 ID ('com.foo') 并将值设置为 UUID在您的 .mobileprovision 文件中。
You can see the provisioning profiles the build will be using by looking here:
ls ~/Library/MobileDevice/Provisioning\ Profiles/
您可以通过查看此处查看构建将使用的配置文件:
ls ~/Library/MobileDevice/Provisioning\ Profiles/
Another useful tool is using the QuickLooks feature of the Finder to see the values of the provision profiles without having to fire up editor.
另一个有用的工具是使用 Finder 的 QuickLooks 功能来查看配置文件的值,而无需启动编辑器。
回答by Victor Choy
use command /Applications/Xcode-beta.app/xcodebuild -help
. You'll have an detail information about exportOptionsPlist
Available keys for -exportOptionsPlist:
使用命令/Applications/Xcode-beta.app/xcodebuild -help
。您将获得有关 exportOptionsPlist 的详细信息 -exportOptionsPlist 的可用键:
....
provisioningProfiles : Dictionary
For manual signing only. Specify the provisioning profile to use for each executable in your app. Keys in this dictionary are the bundle identifiers of executables; values are the provisioning profile name or UUID to use.
....
....
配置文件:字典
仅用于手动签名。指定要用于应用程序中每个可执行文件的配置文件。该字典中的键是可执行文件的包标识符;值是要使用的配置文件名称或 UUID。
....
Here is a sample about option plist
这是一个关于选项 plist 的示例
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>provisioningProfiles</key>
<dict>
<key>com.aaa.bbb</key>
<string>adhoc_bbb</string>
<key>com.aaa.ccc</key>
<string>adhoc_ccc</string>
</dict>
<key>method</key>
<string>ad-hoc</string>
<key>uploadBitcode</key>
<false/>
<key>uploadSymbols</key>
<true/>
</dict>
</plist>