Generating ipa from xcode command-line

2019-03-09 01:27发布

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

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

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

  1. Organizer - Archives
  2. Share
  3. iOS App Store Package
  4. Don't Re-sign

Thanks!

3条回答
干净又极端
2楼-- · 2019-03-09 02:11

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

查看更多
老娘就宠你
3楼-- · 2019-03-09 02:11

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

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

查看更多
小情绪 Triste *
4楼-- · 2019-03-09 02:21

The missing piece is using the PackageApplication utility.

/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 --sign and --embed flags respectively.

查看更多
登录 后发表回答