ios 从 xcode 命令行生成 ipa

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8334500/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 15:42:00  来源:igfitidea点击:

Generating ipa from xcode command-line

ioscommand-linebuildipa

提问by Vasanth

Whats the best approach for generating an IPA file from command-line?

从命令行生成 IPA 文件的最佳方法是什么?

I'm on xcode 4.2 and generating the archive using:

我在 xcode 4.2 上并使用以下方法生成存档:

xcodebuild -scheme AppStore clean archive

This generates the .dSYM and .app files in the build output directory, after codesigning. How should I proceed to generate the .ipa file? In other words, I'm looking for the command-line equivalent of doing the following in GUI

代码签名后,这会在构建输出目录中生成 .dSYM 和 .app 文件。我应该如何继续生成 .ipa 文件?换句话说,我正在寻找等效于在 GUI 中执行以下操作的命令行

  1. Organizer - Archives
  2. Share
  3. iOS App Store Package
  4. Don't Re-sign
  1. 组织者 - 档案
  2. 分享
  3. iOS 应用商店包
  4. 不要重新签名

Thanks!

谢谢!

采纳答案by Joshua Weinberg

The missing piece is using the PackageApplication utility.

缺少的部分是使用 PackageApplication 实用程序。

/usr/bin/xcrun -sdk iphoneos PackageApplication -v $FULL_PATH_TO_APP -o $OUTPUT_PATH

/usr/bin/xcrun -sdk iphoneos PackageApplication -v $FULL_PATH_TO_APP -o $OUTPUT_PATH

You can also pass this script options for resigning, and profile embedding. Using the --signand --embedflags respectively.

您还可以传递此脚本选项以进行辞职和配置文件嵌入。分别使用--sign--embed标志。

回答by Rayfleck

This tool makes it trivial to build (and distribute): https://github.com/nomad/shenzhen

这个工具使得构建(和分发)变得微不足道:https: //github.com/nomad/shenzhen

回答by srikanth Nutigattu

After Archive, you need to "Export" to desired format ie ipa:

存档后,您需要“导出”到所需的格式,即 ipa:

xcodebuild -sdk iphoneos7.0 -archivePath "path to archive file" -exportPath "path_for_export" -exportFormat ipa -exportArchive -exportProvisioningProfile "provisioning_profile_to_export_with"

xcodebuild -sdk iphoneos7.0 -archivePath “归档文件的路径” -exportPath “path_for_export” -exportFormat ipa -exportArchive -exportProvisioningProfile “provisioning_profile_to_export_with”