Monday, December 7, 2009

iPhone tip: don't change ${EXECUTABLE_NAME}

This is a series of quick tips for people who are having a few problems, with ad-hoc iPhone builds and xCode in general.

1) When creating an ad-hoc iPhone app, be sure to have a 512*512 png file in your app called iTunesArtwork . Just iTunesArtwork, no png at the end.
2) Be sure to create an Entitlements file (Add->New File->Code Signing->Entitlements). Name it whatever, and place it in the root, not in any subfolders. Then, go into the information for your target, and set the Code Signing Entitlments field to the name of that file.

The next one is important, as I lost > 30 minutes on it: do not change ${EXECUTABLE_NAME}. This is in the information for your Target, under properties/Executable. I decided to change this, because I had one target for regular development and one for ad-hoc distribution, and I thought to myself, boy, it would be neat to be able to tell the output of these targets apart easily. So I changed that value to CC_AdHoc, and suddenly my code was exploding. The worst error I got was " object file format invalid or unsuitable". It took me a while to realise that it was the ${EXECUTABLE_NAME} that was causing the problem, and once I did, was highly frustrated. So just leave that variable alone, it will save you a lot of problems.

No comments: