First, make sure the Archive build configuration is set to Test Flight; the configuration you had just created. Click on “Post-actions”, and if nothing is in there, click the ‘ ’ at the bottom to create a “New Run Shell Script” action.
Copy each of them to the appropriate location on your OS X Server so the Xcode server can find them: You have to run the copy using sudo, because of tight permissions on the folder. Remember that this Distribution for the account and a Distribution Certificate doesn’t yet exist.
If one already exists, and it isn’t in your keychain already (see below), you may have to either a) manually download the certificate from the i OS Developers portal or b) hunt down the person who has the identity and have them send it to you.
An explanation of important aspects of it are explained afterwards. There are a lot of little nuggets in there worth explaining: With the newly created scheme selected (next to the run and stop button in Xcode), select i OS Device (or any connected device) and go to the Product menu and select Archive.
Make sure the archive process works, because if it doesn’t work on your development station, it sure as hell isn’t going to work on the Xcode server :).
This means your Xcode server has no way of properly signing your app, resulting in build errors time and time again during the archive phase.