tags:

views:

5775

answers:

6

I am new to iPhone development. I just registered with Apple for the iPhone Developer Program. When I try to build, I am receiving an error:

Code Sign error: a valid provisioning profile matching the application’s identifier could not be found

I'm not sure what is wrong. I tried browsing the Internet but I get confused. Can anyone help me with what I should do?

+1  A: 

Did you set up an iPhone provisioning profile for either development, ad hoc distribution, or app store distribution?

If not go to the iPhone developer program portal, which is linked from the developer.apple.com/iphone. Apple has provided a great series of video tutorials.

zPesk
+10  A: 

At first it seems a complex process, but it's pretty straightforward when you've been through it a few times.

In a nutshell the process is this:

(I'm assuming you've set up your iPhone/iPod touch as a test device)

Via the iPhone Developer Portal

  1. Create an App ID (give your application a name, this is just for reference on the website and nothing to do with your own build of your application) enter a string to identify it, like com.yourcompany.appname (this is important and should be the same as in your .plist file inside Xcode) Click and Save this

  2. Go to Provisioning There are 2 provisioning profiles you'll need a) development - so you can install your application on a test device (i.e. your iPhone / iPod touch) b) distribution - if you want to sell the application via the App Store

    You can create the profiles by selecting your App ID, created in the previous step, from the drop down list and clicking Save In a few moments (usually, though it can be longer) the certificate is available for download. Download this to your Mac and drop it onto the Xcode icon. Sometimes the development profile doesn't work for me like this and I drop it directly into the Organiser window in Xcode that shows my connected device.

  3. In Xcode inside 'Edit Project Settings' you can select the certificate you wish to code sign with. Usually for debug I sign with the development certificate. Follow the instructions on the apple site and clone the release profile and call it something like release and sign this with your distribution profile. (You won't be able to load the app onto your phone with the distribution profile selected)

  4. Make sure you select the target device as Device and not Simulator when building for the App Store!

Hope that helps, it's from memory so apologies if I've skipped some small steps.

Neosionnach
A: 

Just make sure you install the certificates or the profile won't be selectable in the project configuration. When you download the certificates double-click on them to install.

BWC
A: 

Do I need a provisional profile per app?

I have one working test app, but the second one I am unable to get onto my iPhone. In my XCode organizer one of my provisional profiles show up as "installed" in the "included devices" section, but the other one doesn't. The two apps have their separate app IDs created in the developer portal.

Christ, it must be possible to make an easier system than this?

I think the problem is that one of the profiles isn't installed properly, but I have no idea why.

Any pointers in the right direction much appreciated!

maralbjo
A: 

You see, I think that is exactly my problem. I now have two provisioning profiles, one for each app. One of them has "installed" in the "installed" column of the "Included Devices" section, the other one hasn't. Which must indicate that one of the provisional profiles isn't correctly installed. How do I install it properly? I have dragged it into my organizer and it shows up, but NOT as "installed". I need a solid rope...

maralbjo
A: 

For anyone else struggling with this - I THINK my problem was that I hadn't successfully compiled to the iPhone simulator before I targetted the iPhone device itself. So if your stuck with this, this may be worth checking out.

maralbjo