如何使用终端创建IPA

San*_*ngh 1 xcodebuild swift3 xcode8

我正在使用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>
Run Code Online (Sandbox Code Playgroud)

Joh*_*rug 6

有几件事情改变了:-exportFormat-exportProvisioningProfile不存在了.此外,-exportPath现在指向实际路径,而不是文件.

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

echo "{\"method\":\"app-store\"}" | plutil -convert xml1 -o /tmp/exportOptions.plist -- -
Run Code Online (Sandbox Code Playgroud)

然后-exportOptionsPlist /tmp/exportOptions.plist在你的电话中使用xcodebuild.