How to create an IPA (Xcode 3)
A question that has come up a couple times is how to properly create an IPA that is compatible with TestFlight. We've found that most of the installation errors were due to incorrectly created IPA files. A good first question would be "what is an IPA?"
An IPA is an iPhone/iPod Touch Application. Basically it's a zip file that packages the .app file that your device is able to install. So, how do we create them? There are 2 ways to do this.
The preferred, easiest, and least error prone is to let Xcode handle the creation of IPAs for you. This is done using Xcode's Build and Archive option. This builds your application, signs it, and stores the application along with the debug symbols. Along with this it also ensures the app is provisioned properly.
To archive your application just follow these simple steps:
1) Select Device as your target and your Ad Hoc configuration as the active configuration. If you do not have an Ad Hoc configuration, Duplicate the "Release" configuration in the Configurations pane of the project's Info panel. Rename this new configuration "Ad Hoc".

2) Under the Build menu option select Build and Archive. Xcode
will build your application and open the Organizer window.

3) In the Xcode Organizer look for your application by selecting
Archived Applications in the left panel

4) Select the application you just built and in the bottom panel
click the Share Application button

5) In the window that pops up select your ad hoc provisioning
profile and click "Save to Disk"

6) Select where you want to save the IPA file. Once it has been saved upload it to TestFlight.
To read further on the Build and Archive, there is an excellent
article that goes into more detail (http://iphonedevelopment.blogspot.com/2010/05/xcode-32-build-and-ar...)
If you are creating an IPA from a .app file, follow these directions:
1) If you are using a 3rd party tool, such as Corona or
Appcelerator, skip down to step 4.
2) Select Device as your target and your Ad Hoc configuration as
the active configuration
3) In the Groups & Files panel, under Products, select your
built .app file, right-click, and select Reveal In Finder

4) Create a new folder called Payload (case-sensitive)
5) Move the .app file into the Payload folder
6) Zip the Payload folder
7) Rename Payload.zip to app_name.ipa

Your application is now ready to be uploaded to
TestFlight.
Tip: If you want your application icon to appear in iTunes when you sync your device back to iTunes follow these steps (referenced from http://developer.apple.com/library/ios/#documentation/Xcode/Concept...)
The iTunes artwork your testers see should be your application’s icon. This artwork must be a 512 x 512 JPEG or PNG file named iTunesArtwork. Note that the file must not have an extension.
After generating the file of your application’s icon, follow these steps to add it to your application:
- Open your project in Xcode.
- In the Groups & Files list, select the Resources
group.
- Choose Project > Add to Project, navigate to your
iTunesArtwork file, and click Add.
- In the dialog that appears, select the ”Copy items” option and click Add.
Common issues caught by TestFlight:
The signing identity used to share this IPA is different than the identity used to build it.
If you are using the share functionality from archived applications in the Xcode organizer this is bound to happen at some point. It is easy to prevent, just make sure you select the same code-signing identity that the ad hoc was built with. If TestFlight did not catch this issue, iOS would throw an exception to your testers when they attempted an install.
The provisioning profile for this build has expired
Pretty self explanatory - renew your profile!
The file is not a valid zip file. Are you sure this is a valid IPA?
A JPEG is not a valid IPA, nor is a PDF with mockups for your next app!
Invalid IPA: could not find the info.plist. Are you sure this is a valid IPA?
We look for the info.plist in the correct path. If you uploaded a zipped version of your source code to TestFlight you'll likely get this error.
Invalid IPA: the .app must be in a "Payload" (case-sensitive) folder.
As mentioned in this article IPAs require a Payload folder. Be sure that you uppercase the P.
Missing embedded provisioning profile. Are you sure this is an ad hoc?
Generally this is caused by hoping that the simulator version of the .app can be packaged up as an IPA.