Wednesday, June 10, 2009

iPhone ad hoc provisioning profiles

In trying to develop for the iPhone you've got to create provisioning profiles, and this was proving to be more complicated than I thought. Going through the directions (creating cert, creating app id, creating provisioning profile) wasn't working. I'd either get an error when trying to sync, or even have trouble creating the app in the first place. Here's what I did to solve it:

Make sure your default keychain is login
Clear off all the certs and start fresh.
Make sure your you are added to the team, and your device is added
Create the initial cert according to Apple's directions, submit it and approve the cert. (do this for both the development and distribution tabs under certificates
Download the two certs and install them.
Download the WWDR intermediate cert and install it.
Create the app id, I used com.overlandagency.appname for the bundle identifier
Create a distribution provisioning profile picking the app id, make sure you select your device
Download the provisioning profile
In Xcode right click on the top item in Groups & Files and select Get info
Under the build tab, under code signing make sure the code signing identity and any iphone OS device have "iPhone Distribution: your name" set
Right click the app under targets (in groups & files) make sure the Code signing entitlements (under code signing) is set to the plist file (you've created according to apple's instructions)
Click the properties tab and make sure the identifier is correct (in this case com.overlandagency.appname)
Click clean all targets in Xcode (this fixed many problems)
Click build, right click on the .app file in products and pick reveal in finder

I ran into problems at one point because my mac had weirdly set itself to the wrong time so I was getting a CSSMERR_TP_CERT_NOT_VALID_YET error, that refused to clear up. Even though I fixed this problem, I couldn't even build at this point, but then making sure I clicked "Clean all targets" fixed this problem, and could have been half of what was going on with issues I was having before.

Labels: , , , , , , ,

5 Comments:

Blogger Jiro Feingold said...

"certificate not yet valid" was the error I was getting connected to the CSSMERR_TP_CERT_NOT_VALID_YET error.

4:39 PM  
Blogger Rock said...

Thanks, it helps me to solve my problem.

Can't believe how the incorrect system time have a huge impact on the deployment

4:36 PM  
Blogger Wilian Segatto said...

This post has been removed by the author.

2:25 PM  
Anonymous Will said...

Thank you very much!

That solved my problem!

2:27 PM  
Anonymous Anonymous said...

Thanks a lot, that really save my problem too.

6:23 AM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home