This covers the steps in preparing your binary which must be submitted to Apple

Prerequiste

It is assumed that you have developed your iphone app, tested it on your iphone device and now are looking to prepare the final binary which can be submitted into Apple. To see the full details of submitting your app, read the tutorials.

Preparing Binary

When you submit your application to apple, their are several files which you must provide before the application can be accepted one of which is a zipped copy of your final binary.

Apple expects several things from this binary before it will accept it, two of these which cause the most problems are

  1. codesigning
  2. bundle id

If any of these are not done correctly then the binary will not upload into Apple. (There are other criterias which need to be met, but are not covered here).

As you may currently be aware, in order to develop applications for the iphone you need a development certificate, which can be downloaded from your ITunes Program Portal. But to submit an app into Apple, you will also need to download and install a Distribution certificate. Information on this can be found on Apple’s site.

Once you have installed the certificate you will need to make some changes to xcode to generate the binary. Remember the binaries which get created for the iPhone device or simulator cannot be submitted into apple, they will fail the upload process, instead a 3rd type of distribution binary must be created.

  1. From the drop down in the tool bar
  2. Currently xcode should be setup with 2 active configurations, Debug and Release. To create our 3rd binary we will need a 3rd config.
  3. Select the root folder under Group & Files and select info
  4. Select the “configuration” tab, copy release and rename it to “Distribution”
  5. Now Select the “Build Tab”
  6. In the configuration drop down select “Distribution”
  7. Under its properties ensure “Base SDK” is pointing to “iPhone Device”
  8. Further down under codesigning->Code Signing Identity->Any iPhone OS Device make sure our Distribution certificate has been selected
  9. That’s it close the window
  10. From the drop down make sure we select the correct sdk and distribution configuration
  11. Open XCode up in the active XDK make sure “iphone Device 3.XX” is selected
  12. Now do a Clean and Build to generate our binary.
  13. You should now be able to submit the binary

Possible Problems and their solution

“The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate”

Each application should contain a unique bundle identifier. If you open up your “<APP_NAME>-Info.plist”, you should have property called “Bundle identifier”, the value of this should match the app id set in the distribution certificate. For example when I created my distribution certificate i created a user assigned to that with the id of

XXX1XXX23.uk.co.mydomain.*

Where XXX1XXX23 is a unique hash value. This meant any application i submitted using my certiifcate would need to contain this info in the “Bundle Identifier”. So I set this value to

uk.co.mydomain.<MY_APP>

If this doesn’t work then next clean up your project and start from scratch by following these steps.

  1. Clear out the build directory removing everything
  2. Open Organizer and delete your code signing profile
  3. Restart Xcode
  4. Read in the code signing info again
  5. Re build the binary
  6. Compress the .app file and re-upload

.