Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating ipa from xcode command-line

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!

like image 437
Vasanth Avatar asked Nov 30 '11 23:11

Vasanth


People also ask

Can you make a IPA in Xcode?

Creating an XCUITest Package​ipa Testing with XCUITest. Open your app project in Xcode. Select Generic iOS Device or Any iOS Device (arm64) as your project's device target. Make sure that the your UI tests are part of a Target Membership and that those Targets are selected to be built in your Xcode Build scheme.

How do I get IPA from Xcarchive?

Now you have to do below steps: Go to Window->Organiser->Archives Here, select your archive fine and click on "Distribute App" button on right side Then Instead of upload, select Export option, and continue selecting default options, it will end you up with generating ipa file.

How do I archive an Xcode project in Terminal?

Xcode 3.2 provides an awesome new feature under the Build menu, "Build and Archive" which generates an . ipa file suitable for Ad Hoc distribution. You can also open the Organizer, go to "Archived Applications," and "Submit Application to iTunesConnect."


2 Answers

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.

like image 86
Joshua Weinberg Avatar answered Oct 28 '22 15:10

Joshua Weinberg


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

like image 42
Rayfleck Avatar answered Oct 28 '22 14:10

Rayfleck