How to set your iPhone / iPod touch as a target

When you follow instruction on “Welcome to the iPhone Developer Program Portal” to figure out how to put your program on an iPhone / iPod touch for testing, you would be a little embarrassed. First, explanation is very long and seems to be not focused well. So, you don’t know what you are doing.

So, I would like to briefly explain the whole procedure or step here.

  1. Generate public / private key pair
  2. Register your iPhone or iPod touch as testing device
  3. Obtain identification string for your application
  4. Provisioning Profiles

1. Generate public / private key pair

This is described as certificates step on Apple iPhone Developer Portal site. However, in general term, it is to generate public / private key pair. This is so-called public key mechanism. Using this public and private key, you can be identified as “you”. So, it is to obtain certificate.

So, as described on Obtaining your iPhone Development Certificate page, they are created using “Key Chain” program which you can find on your Macintosh HD. The private and public key pairs can be found on the “Key Chain” window. Also, the Key Chain will create a “CSR” file. I believe this CSR file is a public key which identifies you.
Then this CSR file should be submitted to Apple iPhone program portal site. Now, the team agent or administrator will accept or approve this.

Now, you need to download WWDR intermediate certificate on Certificates => Distribution page.
Install the downloaded WWDR intermediate certificate to your Key Chain by double clicking it.

If you are a team leader or a team member, you can download your certifcate on Certificates section on the program portal. The file name endes with .cer. You install the .cer file by double clicking it. It will be added to your Key Chain.

These WWDR intermediate certificate and “your” certificate also look to be public keys which are generated for the server side based on the public key, or “CSR” key, you submitted to the Apple’s portal, or the server.
So, you and the portal site interchanged public keys.

Why are there two public keys?
I don’t remember the exact message when each of them were added to my key chain. So, it can be wrong. But I think the WWDR intermediate certificate is Program portal’s public key, which is displayed as “Apple Worldwide Developer Relations Certification Authority”, while “your certificate” is a public key which is a counterpart to your public key, “CSR”. So, The WWDR certificate identifies the program portal, while the “your certificate” is a kind of “agreement” from the protal side for your submitted “CSR”.

So far, I explained how public / private key are created and how to get certification using that key.

2. Register your iPhone or iPod touch as testing device

So far, you and server interchanged public keys. OK. Everything is done basically.
Now, it is time to register your test devices. While you are developing iPhone/iPod touch apps, you can send built binary to this registered device to test your program. Because it is kind of installing a program to devices, Apple wants to control what device you can install your test program. So, add devices you want to target using the program portal site.

3. Obtain identification string for your application

This is a step which can cause some problems.
The app ID, which is for identification, is reverse domain notation like com.yourcompany.program_name. You can also use wild card app ID.

4. Provisioning Profiles

So far, you are identified, and your device is registered for testing. Now, there is one more step. It is to bind you and your device. I think this is for security. Only you, or the one who is identified as you, and your test devices can be involved in this development process.

In this step, the program portal recognizes you and it reqires an app ID generated in previous step. Also it requires your device. Then “you” test “your program” on “your device”. If you provide all the information, you can generate a provisioning profile. What is “provisioning profile”? “Provision” is from “Provide”. So, it is a profile or information to provide, i.e. install, your program to your device. The provisioning profile is created using all the information described above. It contains incremental information from previous step, because in each step, resultant files from previous steps are used.

This provisioning profile should be added to iTunes or Xcode organizer, as well as “application” as shown in this picture.

So far, I explained the procedure how to prepare things to test your apps on your iPhone and iPod touch using general private/public key concept, instead of using Apple’s terminology.

If we use Apple’s terminology, it sounds easy but the whole process looks very complicated.
But if we understand it using public/private key concept, which actually is, it is much easier to understand the whole step.

This is written after more than 2 weeks from when I tried, so my explanation may not be exactly correct for their resultant files. But the overall concept is like what I described.
I hope it would be helpful to understad the overall steps.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: