I'm not talking about philosophical aspects here, I mean the implementation. Apple did a shitty job on this stuff. Anytime I want to build an app for distribution, I lose a day trying to get the damn thing to build right. And it's not that I don't know what I'm doing... I follow the directions exactly, try every logical (and some illogical) permutations of those instructions, and it always takes me many tries to get it to work.
For me, Xcode is prone to not recognizing provisioning profiles, or finding the wrong ones, and the build instructions often simply don't work. When I build for distribution, for example, I cannot use "iPhone Distribution: Jeff LaMarche" for my identity as the instructions say, I have to use just my name in order to be able to select a provisioning profile. And then, I have to delete my developer cert because using just my name is ambiguous and it can't figure out which of the two certs to use, and there's no way to select which one it should use.
Now I'm going through this damn hassle to do an ad hoc distribution to try and send a a work-in-progress app to a client, and even when I do finally get it to build using the right provisioning and cert, it won't install (through either iTunes or Xcode), saying the app couldn't be verified.
I'm about ready to throw something across the god damned room.
It is really frustrating. I've found that changing profiles or any settings in a profile, if I quit XCode, restart and then build I tend to have more success.
Ad-hoc is a pain, completely. I updated the list of devices for my ad-hoc provisioning file the other day, downloaded it, replaced the existing one and when I went into the project settings I could choose a random couple of device IDs as well as the ad-hoc provisioning file, where only the provisioning file should be. Every time I went back into project settings, it would show me a different couple of device IDs. Bizarre. In the end I just set it how I wanted it, closed XCode, restarted it, cleaned the target and built. And that worked.
But yeah, it's a dark art at times.
__________________
Now developing an interactive children's story for the iPad - Arthur and Charles
Yeah, I finally got it working, but took way longer than it should have. Very frustrating. I had to log out and log back into my computer to get it to recognize the right profile.. grr...
I have finished my first iPhone app... I have spent the last four hours trying to get it ready for distribution... I've followed the instructions..and it didn't work. I deleted everything ( certs, etc ) and redid it all .. still no luck.
It compiles.. but then I can see in the build results that it isn't using my mobile provisioning file ...
I skipped the development cert and debugging, as I was trying to go straight to distribution .. does anyone know if this will cause issues?
This is definitely the most annoying process I've ever gone through ...
Agreed. I absolutely dread when the time comes to build for distribution. It never goes smoothly. Sometimes I get it working in just a few tries, sometimes it takes a couple of hours.
I just went through this last night. Here is a tip to try that is straight from Apples docs that got things working finally. First, make sure all your setting are correct (distribution checked, bundle id, etc). Clean All Targets, close XCode, then manually delete the build folder (not sure what clean is doing for me if I delete the build folder). Then open XCode back up, check all your settings again and build. It worked for me last night.
I got it to use my provisioning profile.. but when I tried to upload it through the app uploader.. I'm was getting this error:
Application failed codesign verification
I nuked my build folder and did it again.. and got the same error. I repeated this process 6 times.. doing everything exactly the same.. and on the 6th time ... it worked.
I'm scratching my head... this process is definitely screwed up.
How is it possible that this process is still such a HUGE pain? Every time I try to deploy an app to an actual device I lose 5-10 HOURS!
I've tried cleaning, shutting down Xcode, deleting the build folder, hula dancing. Still nothing. The error message this time is "ambiguous code signing identity".
How is it possible that this process is still such a HUGE pain? Every time I try to deploy an app to an actual device I lose 5-10 HOURS!
I've tried cleaning, shutting down Xcode, deleting the build folder, hula dancing.
All security is a PITA--all.
1st, follow all the instructions in the deployment pdf, make every screenshot match--exactly.
That said the single thing I find people doing wrong is having code signing at the project level, delete it all with the remove command in the action drop-down menu (lower left of the window).
I just went through this with a friend who had spend a day or so trying to get AdHoc setup. He had a bunch of badly named profiles ad devices. I cleared all the profiles, chose a simple appID, renamed it to an easily understood name, created a new profile with an understandable name. I created a new project, deleted all code signing at the project level, set up the required signing at te target level. It compiled and worked the first time.
Finally Xcode 3.2 is better with signing.
In general signing now works "if you let it", that was not the case several months ago.
[snip]
I've tried cleaning, shutting down Xcode, deleting the build folder, hula dancing. Still nothing. The error message this time is "ambiguous code signing identity".
Nice job Apple.
The problem is "hula dancing". It it true that Apple's instructions for hula dancing are paltry at best, but if you look carefully you'll find the proper steps. Google is your friend.
I've had pretty good success by not having excess provisioning profiles in either Xcode or my test devices, only the bare minimum. Then I have gotten reallllllllly retentive about making sure that both the project and target build settings are set for the RELEASE configuration -- the build configuration you see when you get-info often isn't what you have set in XCode so I've horsed around changing provisioning profiles for the wrong configuration and then wondering why release didn't work.
And my hula dance is only invoked after an upload failure... the steps are:
* delete provisioning profiles from Xcode
* get a new, fresh profile from Apple (I don't always do this on the first round)
* drag new profile to XCode
* reset the provisioning profiles for both the project and target
* clean all targets
* quit XCode
* shutdown
* before restart, kneel in front of computer and bow thrice saying "oh, mighty machine". Both hands must be raised in the air held shoulder width apart. <-- crucial step, do not omit, alter or otherwise modify
* restart, relaunch, build (not build and go!), verify mobile provisioning is in the package, compress, upload, and rejoice.
* cross fingers and hit CONTINUE.
in the rare instances where it fails again, I remember that this is software just like Windows is software... and I repeat the dance.
__________________
"Hardware will break. Software comes broken" Unknown Calc-12E <-- ditch your old calculator. CPR•Choking <-- Review your training, just in case. (Free) All of Nature NW <-- scrolls in x and y, with pinch zoom AND scrollable text to boot. It can be done ('taint easy tho)
Sure, I can go through the whole process every time and get it to work after many wasted hours (which I did again this time). The point is that I shouldn't have to do this every time. It's unbelievable to me that Apple fell so short on this stuff.
I make apps for myself and also for other companies, so I need to have different profiles and different devices. It is 99.999% impossible for Xcode to keep things straight. Going through the whole stupid process every single time I deploy a different app to a different device or profile is insane.
I disagree. The process described by tawpie is not necessary. Extra steps that do nothing do work but why do them? Security is a PIA, that is always true but understanding the process makes it work. In the early days there were real problems, today I no longer see them.
The major problem, I see Apple committing is that in the standard template they have code signing in the project even though the docs state otherwise.
Read the docs, they describe exactly what to look for in the build results. One can even look in the profiles and see if the correct device are present. Apple had _now_ described exactly what to do, it works. Yes, it needs to be followed exactly, that is how security is.