Distribute iOS Apps
One of the great features introduced with iOS 3.2 is the distribution system, specially, the capability to build and archive an application.
An archive is like a frozen build. Why this is a great idea? Well, in order to be able to symbolicate a crash report generated by a particular release, the descend that was created from the build has to be preserved. Many of us has accustom to preserve the .dsym files to symbolicate apps. This is now done automatically by the archive.
Another thing that might become handy about archives is that the build is not actually signed, as before. So we can build, send the app to beta testers, and once everything is checked, then sign the app, and send it to the App Store.
An archive is composed by the app itself, and the descend that was built when the app bundle was put together, and a pList with some metadata to allow Xcode to show it correctly in the organizer.
Now, I can hear you, what the difference between an archive an, let’s say, a git tag, after all, the tag is also an immutable snapshot. But it is a snapshop of the source code used to build the app, and not the app itself. There’s no descend in your tag (unless, you were adding it by hand, like I use to). With no .dsym, you cannot symbolicate the crash reports, and life is so much harder.
With your archive already done, you can easily validate the app online against the same validation suite that Apple will use to validate the app when you finally submit it to the store. Actually you should not wait to the online validation, but set on the offline validation in your building settings. The offline validation is not the complete suite, but you are going to be able to find some issues early in the development cycle, when it is much more easy to fix them.
To set the offline validation on, go to the Build Options on your target, and check (or choose the Yes option from the drop down menu in Xcode 4) the Validate Built Product.
Before you can run the online validation from the organizer, you need to configured the app in iTunes Connect. Once the app is configured, in the Archived Applications section in the iPhone Development tab of the organizer, you will find a list of the archived apps. From the archive, you get access to three different buttons,
- Validate Application
- Share Application
- Submit Application to iTunes Connect
When you click the Validate Application Xcode will ask for your iTunes Connect credentials, then it will ask for the distribution profile you want to use to sign your app, it then will re-sign your app, package it up, and uploaded to Apple, where the actual test is going to be carried. The test results are also reported in Xcode.
The Share Application option is great to distribute an app amongst beta testers. You can sign the app with an ad hoc provisioning profile, and mail it (or for the purist like me, save it disk, and upload the ipa to a ftp, and then send a link via email. Email is not meant to be a tool for sharing files, and it doesn’t matter if gmail allow you to attach a 10MB file. If you do this in an email, i hate you). There is also an option to Distribute for Enterprise, which is a new way to reach a huge organization, far more scalable than ad hoc.
Finally, you can also Submit Application to iTunes Connect. Once again, the app is going to be re-sign, and packaged to be send to Apple.