In the Developer Center select ‘iOS Provisioning Portal’

Select App ID’s

Create New App ID

Description: As required

Bundle Seed ID: Generate new

Bundle Identifier: com.mydomain.MyApName (and use this in Shared > MyApName-Info.plist > Bundle Identifier)

Create it

Now go to ‘Provisioning’.  Select ‘Development’ to install your application on a test device and select ‘Distribution’ to sell the application via the App Store

Select ‘New Profile’, give it a name (I use same name as for App ID but with ‘Devel’ or ‘Release’ on the end)and select the App ID you just created.  Select the devices and press Submit. After a few moments refreshing the browser will have the certificate available to download.  Download it then open it.