Dear Lazyweb,
I finally got registered for the iPhone app developer program. I created a certificate for “iPhone Developer: Jake Sprouse”, uploaded it to Apple, approved it, and downloaded it into my Keychain. I registered the Device ID of my iPhone on the Apple website. I created an App ID for all jakesprouse.net applications (it’s of the form NNNNNNNNNN.net.jakesprouse.*). And I created a provisioning profile with the certificate, Device ID, and App ID.
In my XCode project, I changed the “Code Signing Identity” field to “iPhone Developer: Jake Sprouse” under my provisioning profile in the drop-down. And I changed the “Bundle identifier” field of my Info.plist to NNNNNNNNNN.net.jakesprouse.${PRODUCT_NAME:identifier}.
Now, when I build it, I get the error message: /Users/jakes/src/MyApp/build/Debug-iphoneos/MyApp.app: object file format invalid or unsuitable.
If I build a second time, it works, but when it goes to install the app, the Organizer window tells me “The Info.plist for application at /Users/jakes/src/Sac4iPhone/build/Debug-iphoneos/Sac4iPhone.app specifies a CFBundleExecutable of (null), which does not exist“.
If I build a third time, I get the object file format error again (and so on…).
Searching Google on codesign + "object file format" is not being very helpful. Anyone out there have any ideas?

December 22nd, 2008 at 9:51 pm
With help from @mdhughes, I was able to get my app running.
* Info.plist was being included in the main target. Apparently this was causing the “object file format” error.
* Using “net.jakesprouse.${PRODUCT_NAME:identifier}” instead of “NNNNNNNNNN.net.jakesprouse.${PRODUCT_NAME:identifier}” cleared up the CFBundleExecutable issue.
* Cleaning and rebuilding early and often seems to be a good idea.
March 23rd, 2009 at 4:13 am
Thanks for pointing out it was the plist thing, took forever to find someone with a clue
Thanks for the post.
April 13th, 2009 at 5:26 pm
Restart x-code, that fixed it for me….
July 2nd, 2009 at 2:49 pm
Indeed remove the Info.plist from copy resources, clean all, and restart XCode
July 6th, 2011 at 4:01 pm
Problem for me was twofold in Xcode 4:
1) The .plist file was being included in the application bundle. Fixed this by removing it from the “Copy Bundle Resources” list under “Build Phases” of the Target.
2) I had changed “Executable file” to something other than $(EXECUTABLE_NAME), which Xcode just doesn’t approve of. Why even let us change that if it’s going to break code signing?
Hope that helps someone else who’s wasting hours trying to figure this stuff out.