What a pain. Setting these up is necessary to run your app on devices but every time I do it I find myself raging. Here are some notes that I hope will ease the pain.
1) Go to https://developer.apple.com/membercenter/ to set up most of the stuff.
2) Make new profiles and certificates every time you add new devices. You can’t just add devices and hope they update – they won’t. Delete the old ones.
3) Set up the certificate first. The profile will need a certificate to get made. When creating a certificate signing request in Keychain Access, make sure to select ‘All Items’ under Category first.
4) To test on your app, you need a developer certificate and developer profile. To distribute to other devices (eg. via testflightapp.com) you’ll need a distribution certificate and an ad hoc profile.