【问题标题】:xcodebuild -exportArchive fails for tvOS appsxcodebuild -exportArchive 对于 tvOS 应用程序失败
【发布时间】:2015-12-01 06:20:43
【问题描述】:

如果我尝试使用xcodebuild 的命令行从.xcarchive 导出.ipa,如下所示:

xcodebuild archive -scheme "Cross" -archivePath "build/Cross.xcarchive"
xcodebuild -exportArchive -archivePath "build/Cross.xcarchive" -exportPath "build/Cross-tvOS.ipa"

失败并出现错误“平台未知:appletvos”:

+ xcodebuild -exportArchive -archivePath build/Cross.xcarchive -exportFormat app -exportPath build/Cross-tvOS.ipa
--- xcodebuild: WARNING: -exportArchive without -exportOptionsPlist is deprecated
2015-11-30 22:13:44.403 xcodebuild[42874:30912505] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-9081/IDEFoundation/Execution/Archiving/IDEArchivedApplication.m:148
Details:  Asked if we support packaging as a given format, but the platform is unknown: appletvos
Object:   <IDEArchivedApplication: 0x7f89bea3e990>
Method:   -supportsPackagingAsFormat:
Thread:   <NSThread: 0x7f89bbc320d0>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
error: archive at path '/Users/pol/Downloads/Cross/tvOS/build/Cross.xcarchive' cannot be exported as APP
** EXPORT FAILED **

我可以使用 Xcode Organizer 成功导出 .ipa。这是在 Xcode 版本 7.1.1 上观察到的。

【问题讨论】:

    标签: xcode7 xcodebuild ipa tvos


    【解决方案1】:

    事实证明,错误消息具有误导性。如果您未指定 -exportOptionsPlist 参数,则会发生此故障。

    即使像这样传递一个假的空 .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/>
    </plist>
    

    【讨论】:

    • 您能否详细说明这是如何解决问题的,听起来您只是在解释导致您所面临问题的其他原因。您的原始问题根本不使用 plist 选项,因此此答案似乎不适合作为解决方案。
    • 不是真的,这实际上是重点:失败是如果你没有通过 -exportOptionsPlist 参数,我没有这样做。
    • 现在更有意义了,感谢您编辑文本。
    猜你喜欢
    • 1970-01-01
    • 2018-09-13
    • 1970-01-01
    • 2016-01-10
    • 1970-01-01
    • 1970-01-01
    • 2021-10-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多