Creating Proper IPA Files in Xcode 4

Xcode 4 has changed a lot of things. Most of those things are ok, but occasionally I find that I just cannot do something any other way than to use Xcode 3.

Until today, I was creating Ad-hoc builds for my current project with Xcode 3, then selecting Share & saving the resulting IPA file to disk.

Xcode 4 has the new "Build -> Archive" menu option, but every time I'd try to share this file, I'd presented with this lovely restricted dialog box:


With the errors No Packager exists for the type of archive and This kind of archive cannot be signed.

As it turns out, if you have static libraries that you're linking in, your Archive step actually outputs those as well. Xcode doesn't know how to create an IPA out of 1 .app file and a handful of .a files, so it gives up.

You can tell that Xcode 4 is doing this if your Organizer -> Applications list shows an icon like this:


If you right-click on this build, and select "Reveal in Finder" you'll see the files are .xcarchive files. Right click on that and select "Show Package Contents" to see what I'm talking about. If you see a usr/lib/mystaticlibary.a file, then read on for the fix.

You need to tell Xcode 4 not to "install" the static libraries. For each of the static library targets, select them in Xcode 4, and under Build Settings, search for "Skip Install". Set that flag to YES. I had to do this to both of the static libraries I include in my project.


Once that's done, your app should show a normal icon again & have the ability to export to IPA just like before. Yay!


Huge thanks to this stackoverflow question for pointing me in the right direction.