27
2017
09

解决打包脚本在 Xcode9 环境下报错

最近把 Xcode8 升级到了最新的 Xcode9, 再用之前给项目打包的时候,发生了如下的报错信息:

xcodebuild[35724:1897631] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/b9/9dy06b4n2g13w7y2ltjwpdvnd55qr0/T/TestApp_2017-08-10_10-30-11.908.xcdistributionlogs'.
xcodebuild[35724:1897631] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fe1874348b0>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
    "Error Domain=IDEProvisioningErrorDomain Code=9 \"\"TestApp.app\" requires a provisioning profile.\" UserInfo={NSLocalizedDescription=\"TestApp.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the \"provisioningProfiles\" dictionary in your Export Options property list.}"
)}
error: exportArchive: "TestApp.app" requires a provisioning profile.

Error Domain=IDEProvisioningErrorDomain Code=9 ""TestApp.app" requires a provisioning profile." UserInfo={NSLocalizedDescription="TestApp.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}

** EXPORT FAILED **

根据提示的报错信息摸索了一番终于解决了问题,需要在 exportOptions.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.xxxxx.bundleID</key>
        <string>UniversalDis</string>
    </dict>
    <key>method</key>
    <string>enterprise</string>
    <key>teamID</key>
    <string>XXXXXXXXX</string>
</dict>
</plist>

问题得以解决,希望对大家有用,如有其它问题请关注下面公众号私信。


如果想获取更多的讯息,请扫描下方二维码关注我的微信公众号:

这里写图片描述

上一篇:TextView下划线的添加,控制下划线和文字的距离 下一篇:iOS UIView、UIImageView旋转产生边界锯齿的完美解决方法