2 Apr 2012

Xcode - Ad Hoc Part 2








Creating a Distribution Build

The first thing to do is create a distribution build configuration in Xcode.

In your project settings, duplicate the Release configuration profile and name it Distribution.

See Below...
1. Select Project Info ...
2. Select the Release Configuration ...
3. Hit the "+" button and Duplicate...




If you used Xcode to configure your development machine you should already have both a development and deployment certificate installed in your keychain, looking something like this. If you don't then you will need to make sure you have a matching private key for both the development and distribution certificates.

You only need one copy of the Distribution Certificate...
If you have more than one iPhone Distribution certificate... An error will occur and the build will fail. The error is something like: "You have more than one distribution certificate in your keychain, Xcode only requires one".

If you have more than 1 certificate, then open keychain access and remove the oldest version.



Next switch back to Xcode...

1. Go to the build settings for the project ...
2. Find the Code Signing section...
3. Switch the Code Signing Identity for the Distribution build configuration to iPhone Distribution (which should then say (currently matches '...') if you have your keychain in order!
I selected the "Code signing Identity" heading and changed it all to "iPhone Distribution"...





To actually create the build we are going to use the automatic build and archiving feature built in to Xcode...
However the default configuration an archive build is the Release build configuration.

To change the default to our new Distribution configuration...

1. Select the Edit Scheme... menu option from the Xcode 4 Product menu
2. Change the Build Configuration setting for the Archive task to Distribution.

Archiving...

Finally, select the Archive menu option from the Xcode 4 Product menu and a fresh build of your application will be created and archived.

Product.... Archive

The Xcode organiser should be shown with the archive selected.




In Xcode 4.3.1 there is no "share" option in Archives tab of Organizer to create IPA.

1. To create IPA just click "Distribute"
2. "Save for Enterprise or Ad-Hoc Deployment" ...

and finally....

3. This is a Huge deal!!!!
After u click "Save for Enterprise or Ad-Hoc Deployment" ...
on next screen...Under code signing identity, click the box and "refresh
code signing identity", then select your profile.

You need to do this as the mac/xcode does not automatically refresh this data..
so you could be using the wrong certificates/profiles.



1 comment:

MZONE3D said...

Another helper link is here...

http://www.musicalgeometry.com/?p=1237