如何使用终端创建IPA

时间:2017-03-31 10:31:46

标签: swift3 xcode8 xcodebuild

我正在使用XCode 8.3。如果我在终端中触发此命令以进行存档,如下所示。它显示了这种错误。你能帮我找出解决方案吗?

xcodebuild -configuration Release -exportArchive -exportFormat ipa -archivePath "/Users/Desktop/Demo.xcarchive" -exportPath "/Users/Desktop/Demo.ipa" -exportProvisioningProfile "Demo Development"

xcodebuild: error: invalid option '-exportFormat'

Usage: xcodebuild [-project <projectname>] [[-target <targetname>]...|-alltargets] [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
  xcodebuild [-project <projectname>] -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
  xcodebuild -workspace <workspacename> -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
  xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
  xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]] [-json]
  xcodebuild -showsdks
  xcodebuild -exportArchive -archivePath <xcarchivepath> -exportPath <destinationpath> -exportOptionsPlist <plistpath>
  xcodebuild -exportLocalizations -localizationPath <path> -project <projectname> [-exportLanguage <targetlanguage>...]
  xcodebuild -importLocalizations -localizationPath <path> -project <projectname>

1 个答案:

答案 0 :(得分:6)

更改了一些内容:-exportFormat-exportProvisioningProfile不再存在。此外,-exportPath现在指向实际路径,而不是文件。

您必须使用导出选项创建plist文件。这是一种简单的命令行方式:

echo "{\"method\":\"app-store\"}" | plutil -convert xml1 -o /tmp/exportOptions.plist -- -

然后在致电-exportOptionsPlist /tmp/exportOptions.plist时使用xcodebuild