19

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?

Roger Gilbrat
  • 3,755
  • 5
  • 34
  • 58

1 Answers1

13

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.

Jonah
  • 17,918
  • 1
  • 43
  • 70
  • 1
    Jonah, will this script also archive the build? I like having things archived in XCode for easy of symbolicating crashdumps. – William Denniss Jun 20 '11 at 02:36
  • I've been skipping Xcode's "archive" step and pushing the app and dsym as tagged git commits whenever I distribute a build. I haven't tried to automate archiving in Xcode recently enough to have an accurate idea how feasible that would be. Maybe for my next iOS project. – Jonah Jan 17 '12 at 20:04