AppStore and Adhoc distribution profiles – Howto
Many developers have been facing issues with building iphone applications using distribution profiles (AdHoc and AppStore). Often the correct distribution profiles don’t appear in the build settings in XCode.
I have been struggling with this for quite some time as well, but as of late I seem to have found a method of working that always does the trick. What it comes down to, is that when you want to change the build settings, as well as when you want to build a distribution version, you need to make sure that a device (iPhone, iPod Touch) is connected to your Mac. If you don’t connect it, there’s a good chance that the build profiles don’t show up in the build settings. Connecting the device and restarting XCode usually fixes this.
The practice I’m using currently, is that whenever I want to build for testing in the iPhone simulator I make sure no device is connected, and when a build is destined for a device I make sure that a device is actually connected. I make it a habit to connect or disconnect the device (depending on the build target), and restart XCode. This is a bit of a hassle, but at least it gives me predictable results.