Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fully automate from build to .ipa file in xcode 4

In xcode 3, using a bash script, I could run xcode from the command line, then take the files in the build directory and zip them up into a .ipa file, allowing for a fully automated build process for my adhoc iOS distribution. Anytime there is human intervention, there is the possibly for error.

Under xcode 4, this seem to be not possible anymore. The build directory has been replaced with a DerivedBuilds folder and it uses some obfuscation naming, so it's not possible to let an external script find the files.

In xcode 4, after the build, I need to run Produce->Archive, then selected the file in the organizer, then select save, then navigate to the final folder and name the file and hit save. This is a very error prone process better left to machines.

So, is there a way to go from a clean build all the way to a signed .ipa file? I've got to believe this is possible, there is no way people with automated build processes are having to do this step by hand.

Does anyone know how to do this?

like image 448
Roger Gilbrat Avatar asked Jun 11 '11 16:06

Roger Gilbrat


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 make an 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.


1 Answers

Sure, the script I have been using in my continuous integration environment is available at https://gist.github.com/949831 That might do more than you need but should be able to serve as a base for whatever steps you want to include in your build process.

As you noted it would be hard to predict the derived data path Xcode will use but it is not too hard to located it in the build output as part of the build script.

like image 139
Jonah Avatar answered Sep 17 '22 20:09

Jonah