iPhone Certificate Fog - iphone

This question is, in some ways, a follow up on my earlier question regarding Push Notifications. After much time wasted I have more or less concluded that the issues I am running into, particularly with Titanium, are down to my not configuring my Keychain in the right order. I am now contemplating redoing it all from scratch but thought it best to first post a question here to establish the right way. Here is what I am planning to do
Log in to my Apple iOS provisioning portal account, download and install the Apple WWDRCA cert
Open up KeyChain and create a new certificate signing request. I call it myname.certS... .
Go to the provisioning portal account and use the CSR created above to secure my development and production certificates.
Download and install those certs on my machine by double clicking on them
Back in the provisioning portal create my first appID - call it, com.example.push
Back in KeyChain create a new csr - push.certSig... .
Back in the provisioning portal choose the new appID and configure it for Push using the new csr
Still in the provisioning portal select Devices and add the UUIDs for the devices on which I want to test my app
Still in the provisioning portal select Provisioning and create a new development and production provisioning profile for the app. The latter has AdHoc selected. Use the certificates created earlier. At this stage assign only one device in each profile.
Submit the profile, wait then edit it and add the remaining devices - I am doing this because I have read that there is bug somewhere that stops the provisioning profile from using the Push configuration for the appID in question the first time round
Download and install the two provisioning profiles
Well as I write I have followed all of these steps. I then wrote and compiled a simple Titanium mobile project and tried the Install To Device option with the AdHoc profile created above. Everything went swimmingly well and I got my IPA. I took the IPA and fed it to TestFlightApp which reported Invalid Profile: developer build entitlements must have get-task-allow set to true. So I tried again with the Development profile. This time round TestFlightApp accepted the IPA. In installed it on my iPad but still find that registerForPushNotifications is going away into the ether with nothing being reported - no success, no erors... just a defeaning silence.
I have to admit that I am at my wits end here. I am clearly doing something wrong but I haven't got the foggiest idea what it could be. If I had a million dollars I would give em away to anyone who could set me on the right track. Well I don't so I hope someone just puts me on the right track out of sheer goodness

tried the Install To Device option with the AdHoc profile created above. Everything went swimmingly well and I got my IPA
That doesn't sound right. You aren't installing to a device, you're generating a distributable build. I'm not familiar with Titanium's build process, but in Xcode 4, you select Archive to generate the IPA, and Xcode generates the appropriate entitlements at that point. If you're using an option intended to install directly onto a device, it won't generate those entitlements.
So I tried again with the Development profile.
This doesn't sound right either. You should be using the distribution profile.

Related

Error When Uploading IPA to TestFlight Using New Target

I recently created a new target in my project for the Lite version of my app. Now when I go to upload the .ipa to TestFlight so I can distribute it to my designer, I'm getting:
Invalid IPA: The keychain-access-group in the embedded.mobileprovision
and your binary don't match.
Seems clear to me the reason this is happening is because of the new target. Does anyone know what exactly do I need to change to get this to work?
I had this same problem. It was caused by having the wrong release code signing identity in the target's build settings. You won't need an entitlements file.
Check you are code signing with the correct Distribution profile.
Under Xcode project select > Build Settings > Code Signing
Code Signing Identity:
- Debug > iPhone Developer
- Release > iPhone Distribution
Provisioning Profile:
- Be sure to select a Distribution profile here!
When you created a new bundle you probably didn't change the entitlements and access groups. Make sure you change these in the entitlements file. Have a look at http://www.karlmonaghan.com/2012/08/09/invalid-ipa-the-keychain-access-group-in-the-embedded-mobileprovision-and-your-binary-dont-match/ on how to do this.
Should look like this
If you don't use an entitlements file...
Double check that your developer certificate and provisioning profile used are up-to-date (even if you have the confidence inspiring green tick in the organiser.) Refresh the profile by visiting the Apple Provisioning Portal and edit / modify the provisioning profile, you're using to sign the app.
Un-click and click the signing identity, so that you can submit the form, and the profile will be regenerated.
Wait a minute (really), Go back to XCode and remove the profile from the organiser, next refresh the profiles, and it should re-appear, as the regenerated version.
Once that's done, try archiving / signing the ipa, and upload to TestFlight.
(use the TestFlight app, to speed up this process.)
Here's what worked for me:
Using Automatic (Enterprise Distribution) Profile Selection for all Code Signing Identities I've Established.
Selecting "Refresh Certificates" when going through the Enterprise/Ad Hoc distribution workflow
I have such kind of problem, I am not sure you have the same one or not.
If I have a installed app with the same app id that I am going to install but with a different target, it creates problem. Seems apps are unique with app id and target. So I had to delete the app to install another app with the same app id but different target.
You have good other answers here, but just to stress something out.
If you worked for more than 1 client, and you actually used more than 1 developer account, then the automatic selection of Code Signing Identity on Archive wizard could be different than the one you need, and you might need to select it each time you create the AdHoc version.
Here is a picture, to show you where your error might be (thats where mine was):

Xcode says: "Identity ___ is not trusted." and won't allow me to submit my app

I've been living the nightmare of trying to submit an app to the iTunes store... The newest massive waste of time is an error message that I get when I try to validate or distribute my archive from the "organizer".
The exact message is:
My Xcode is version 4.3.2. I'm pretty sure my WWDR is installed, because this has never been an issue before. I also tried to re-install it just to be safe.
The most frustrating/confusing part is that I JUST submitted my app successfully two weeks ago and nothing was changed. My app was rejected for meta-data reasons. I fixed those issues, re-installed one of my plugins, and now this.
Any suggestions? Even a link to some helpful documentation would be great. I've found the Apple developer docs extremely confusing and UN-helpful.
EDIT1:
I think I may have gotten closer to the problem. I changed some of the build settings and now my build fails with this error:
Code Sign error: Certificate identity 'iPhone Distribution: [my name]' appears more than once in the keychain. The codesign tool requires there only be one. I want to fix this but I'm not clear on which code signing profile should be set where. There are different settings depending on whether I click the "project" icon or the "target" icon and each of those has four different choices. Do all of these require code signing? Can anyone give me an example of a working configuration?
EDIT2:
I think I maybe found the problem. There is a small note that says my Distribution profile has no provisioning portal. I've been downloading and installing new .mobileprovision files but they all say "Developer". I think just need to figure out to download a new distribution profile.
SOLUTION:
Thanks to some pointers from Saad (see below), I figured out what was wrong. I was using the auto-select option for code signing, and the only distribution profile had an invalid provisioning profile. This happened very quietly, and I'm not sure why. I only noticed it when I went back into the provisioning portal to create a new distribution profile. After installing this, everything works.
your provisioning profile is not properly set
Code Sign error: Certificate identity 'iPhone Distribution: [my
name]' appears more than once in the keychain. The codesign tool
requires there only be one.
Open Applications > Utilities > Keychain Access and search for your Distribution certificate. Sometimes the Xcode Organizer decides to generate a new certificate for you and invalidates your old one, but does not remove it from your keychain. Remove the expired/older certificate and quit/re-launch Xcode (make a backup first, in case, by dragging to Desktop or Exporting). That should at least clear up part of your problem.
As for the provisioning profile, if that still is a problem, I'd manually go into the iOS development center and download the App Store Distribution Provision Profile for your app, removing all other provisioning profiles, until you figure this out. Quitting and relaunching Xcode when dealing with certs/provisioning profiles is something I've always had to do.
project identifier and your profile identifier must match

Preparing Ad Hoc Distribution for my app

I have been reading several tutorials and watching some iTube videos to see how I best prepare my app for Ad Hoc distribution. However the information I got is not really consistent, it goes from the 5 step explanation from the Developer Center of Apple to a almost 3 minutes video, where I would have to set some Code Signing options in XCode, create and zip the Archive etc.
My questions:
1.
Is there a tutorial available, which explains everything required, but not too much? I somehow feel, for instance, that code signing is not really required.
2.
After I tried to install the app using iTunes, the synch claimed that it was not able to install it. Is there some log available in iTunes, so I can check for further error details?
3.
How about switching from Ad Hoc distribution mode to normal developer mode? After I followed the steps from the video and prepared my app for Ad Hoc distribution, I was not able to install it on my device anymore, I got the error
Build target Abiliator
Check dependencies
[BEROR]CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 5.0'
This is the video tutorial on iTube I followed: Demo of iPhone app Ad Hoc distribution
Thanks for your feedback and have a great weekend.
OK, looked up the Error
" the following job tried to hijack the service..." and saw that a reboot of the iPhone may solve the issue... and guess what, I was chasing a phantom all day long.....
It works perfectly.
So last hint for anyone, having a similar issue, after installing an app via Ad Hoc the first time: Reboot iPhone, otherwise the app may crash.
Cheers and now good nite :-)
PS: Just to round this thread up here the steps I did at the end (as mentioned, I am using XCode 4.2.1) :
Added my device on the Provisioning Portal (this had been done long time ago, however it is an important step, as the beta testers device IDs also need to be registered here before you re-create and download the distribution profile)
Created and downloaded an iOS Distribution Certificate in the Provisioning Portal
Imported the certificate in my Keychain
Created a Ad Hoc Provisioning File in the Provisioning Portal
Downloaded that profile
Double clicked the profile, which added it to the XCode Organizer Provisioning Profile Section)
Added the options Any SDK and Any iOS SDK in for Ad Hoc Distribution Code Signing Identity in the Code Signing section of my project AND my target and set the values with my Ad Hoc Provisioning File I just created and imported
Made sure the option in my app .plist file "Application requires iPhone environment" was set to true
Ran a clean (Product / Clean) and then a build only (Product Build)
Made sure the app was not installed on my iPhone (as I was testing before via XCode)
Copied the target (group Products via Show in Finder) to iTunes via Drag and Drop (I dropped it into the Media section)
Copied the Ad Hoc Provisioning File into iTunes via Drag and Drop (also to the Media section)
Made sure the app was checked for the synch, synched iTunes with the iPhone
Lastly rebooted my iPhone! However, I am pretty sure, that this might occur on the Developers device only. I assume that the reason for that was a process, still remaining on the iPhone, from my last test via XCode.
I did not use an entitlements file. I have actually to find out, what that file is really for, I have read that it might be required only, if using iCloud. And XCode 4.2 developers, there is nothing like File / New / Entitlement Template anymore in XCode. The file is created as soon as you check the option Entitlements and give the file your desired name in the Summary tab of your target.
You may also want to download the iPhone Configuration Utility from apple
I will also recommend this to my beta testers, as it allows you to see the console log of the iPhone, which of course might be very helpful in case of errors.
Hope this summary helps others, setting up their app for the first Ad Hoc distribution.
Cheers, René
code signing is simple.
first you create a mobileprovisioning profile for your apps bundle identifier also add the devices you want to built the app for. for adhoc build do it in distibution tab. download it, double click add it to keychain.
now you tak your app in xcode.select coreect profile(code signing). set command line build to distribution, oh i forgot create a new file(entitlements.plist) set debug inside it to false, add its relative path in the target, just above codesigning specified. now select the iosdevice on top left(where you select the simulator) press command+b to build the app. the app would be in the products folder(at the bottom) locate it in finder drag it to itunes, may be provisioning profile too, and sync it. done.
Go to https://developer.apple.com/devcenter/ios/index.action and login. You can find 'iOS provisioning portal'. And after going there, choose 'Distribution' section. Select "HOW TO", you can find necessary steps there.

IPhone App Provisioning Account For Multiple Developers

Ive only previously been developing the Apps for our company by myself and Provision management has been quite simple. We have now added another developer to the project and i am having trouble setting up the provisioning for both of us to deploy and test to out iphone.
Does anybody know if there is a step by step or any tips on how to set up provisioning for a multi developer scenario project?
Thanks
Probably you are having trouble sending the iphone developer certificate, if you want to share it, you have to share the private key of the certificate. Not only the public part which can be downloaded from the member center. For that, you have to get into the KeyChain, look for the developer certificate, expand it and right click over the key, then export the key and send it to the new developer.
Hope this helps
We use a team provisioning profile that was created and managed by xcode. If we get a new developer they just login to the dev portal in organiser and then they can deploy. Unfortunately I can't remember how I did it because it was like two small things and it just worked.
You will need to:
Export your Developer Cert from your
KeyChain and send it to your second
developer
Export your Distribution Cert from
your key chain and send it (if you want him to be able to submit to the app store or send out ad-hoc builds to beta testers)
Go to your Provisioning Portal and
add his device to your portal
Then go hit edit on all your
provisioning profiles, adding his
device to each of them
You will both need to download the
new versions of your provisioning
profiles
(Adding his device to the portal & downloading new profiles can be done through the xcode organiser, its usually faster that way)

Code Sign Error When Building iPhone Application

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?
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
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
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.
Besides, if you are in a team account, team admin need to edit Development Provisioning Profiles, and add modify your certificates privilege.
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)
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.
xcode top left corner make sure you're running as "similator" "iphone"
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.
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.
Possibly more use for others seeing this issue on a previously configured dev environment.
This error is also shown if your provisioning profile has expired, in this case you can go through the steps in Neosionnach's answer or you can go to Organizer, click on the profile and click Refresh.
This was the winner for me when I had this issue.
As of July 2012, you can go here:
https://developer.apple.com/ios/manage/overview/index.action
Then launch the "Development Provisioning Assistant." It walks through all the steps outlined by FiddleMeRagged.
You can use this process to create a Wildcard ID, if you're just looking to test your app on your iOS device and don't need to deploy to the App Store right away.