12th
Running Apple sample code on your device
Just a quick note about getting Apple sample code (or other people’s examples in general) to run on your device. Let’s take LazyTableImages as an example.
I’ll assume when you write and build your own code, it works fine. Starting new projects in Xcode from scratch usually results in something that will run on your device.
There is a nice summary of things to check if nothing builds and runs on your device on the Apple Discussion Forum.
The problem I’m writing about here occurs when you try to work with someone else’s project, which has their settings, or generic projects settings.
In the case of LazyTableImages, you download the project .zip file, unzip it, and double-click LazyTableImages.xcodeproj, select Device - 3.1.2 | Debug from the Active SDK pulldown in the upper-left corner, and hit Build and Run.
Note that Active SDK step sounds “obvious” but if the project was made with an older SDK, you may not have the frameworks it’s looking for. Make sure you target the SDK installed on your device. This is especially a problem with open-source projects, which seem to get stale quickly.
And this is the error. Your device “doesn’t have the provisioning profile with which the application was signed.”

Now, Apple has added a nice option here: “Click ‘Install and Run’ to install the provisioning profile ‘iPhone 3GS’ on ‘iPod Touch’ and continue running ‘LazyTable.app’.”
Do you see what is wrong with this picture? Yeah, I have more than one provisioning profile, and actually, I don’t want to use my iPhone 3GS profile on my iPod Touch.
So we cancel.
Then the Xcode status bar grumbles, “Failed to upload LazyTable.app”
Your log may show something like:
Sat Dec 12 10:57:10 unknown mobile_installationd[1468] <Error>: 00808a00 install_embedded_profile: Skipping the installation of the embedded profile
But the app actually was installed, and launches fine. That’s kind of annoying.
The fix is quite straightforward:

Whenever you work with someone else’s project, you need to edit the Info.plist and make sure that Bundle Identifier matches your development certificate. I set mine to be com.nuthatch.* so basically anything will work.
(You’d be surprised how many apps on the App Store still have com.yourcompany as their Bundle identifier.)
That’s the obvious problem.
Remember, I have more than one provisioning profile, and if you’ve read this far because you recognize this problem, you’ll want to fix one more thing:

Double-click the project icon to bring up the Project Info window. The Build pane includes a Code Signing option, and the Automatic Profile Selector doesn’t work for me. It always wants to use my iPhone 3GS Profile (“currently matches…”), so I manually select iPod Touch as shown above.
Done and done.
Note if you make these fixes and the app still refuses to install:
- Delete the app using the Organizer (do not use Springboard on device!)
- Build : Clean
- Quit and restart Xcode
After that happy dance my demo app deployed just fine.