How to create IPA using terminal [duplicate]

痴心易碎 提交于 2019-12-05 06:29:05

问题


I'm using XCode 8.3. if I fire this command in Terminal for making an archive as shown below. It shows this kind of error. Can you help me to find out the solution?

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:


A few things changed: -exportFormat and -exportProvisioningProfile don't exist anymore. Also, -exportPath now point to an actual path, not to a file.

You will have to create a plist file with your export options. This is an easy command-line way to do this:

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

Then use -exportOptionsPlist /tmp/exportOptions.plist in your call to xcodebuild.



来源:https://stackoverflow.com/questions/43138514/how-to-create-ipa-using-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!