Setting Up the Certificates You Need for Development

Một phần của tài liệu Game Development for iOS with Unity3D 2012 (Trang 56 - 59)

2. Getting Set Up for iOS Development 31

2.8 Setting Up the Certificates You Need for Development

bundle identifier in your game and the one registered in the profile in the Developer Center.

2.7.4 Provisioning

In this tab, you can edit, download, or remove provisioning profiles. We will visit the functions of this tab in Section 2.8.

2.7.5 Distribution

The Distribution section only contains information (and step-by-step guides) on pre- paring and submitting your iOS app for delivery. Distribution profiles are generated through the Provisioning section, and a Distribution Certificate is generated in the Cer- tificates section. (We will cover this in detail in Chapter 9.)

2.8 Setting Up the Certificates You Need for Development

All applications to be sold on the iTunes Store or to be installed onto iOS devices must be cryptographically signed using an iOS Development Certificate, which is a small file generated by the Apple Developer website and downloaded onto the development machine. Without that file, the developer will be unable to build iOS-ready applications.

To create an iOS Development Certificate, we first need to generate something called a Certificate Signing Request (CSR) using a program called Keychain Access, which comes preinstalled on your Mac.

A quick note about certificates is that they are only valid for one year from their date of issue. An app will no longer run on any of your development or test devices if its associated certificate expires and, according to Apple, it is best to reissue a certificate prior to expiry rather than letting it lapse and creating a new one. That’s just something to keep in the back of your mind, for now. You can keep an eye on certificate expiry dates via the provisioning portal section of the Developer Center.

2.8.1 Generating a Certificate Signing Request

Using Finder (or the magnifying glass search tools on your Mac, if that’s your thing), find the Keychain Access tool. It is installed in Applications–>Utilities. Launch the pro- gram and you should see something like Figure 2.3.

1. Click on the menu Keychain Access–>Preferences. Set the Online Certificate Status Protocol (OSCP) and Certificate Revocation List (CRL) to Off.

2. Choose the menu Keychain Access–>Certificate Assistant. From there, click Request a Certificate from a Certificate Authority.

3. The Certificate Information demands that you enter a name and email address.

(We can ignore the CA [Certificate Authority] email address field, as it will not apply to this process.) Fill in those two fields, but be sure to use the same information that you submitted when you registered your developer account.

The name and email address must match with those associated with your iOS developer subscription, or your certificate will not work.

4. Click on the Saved to Disk option from the radio buttons and, if prompted, select the Let Me Specify Key Pair Information option.

5. Click the Continue button.

6. If the Let Me Specify a Key Pair was selected, specify a filename (I recommend saving to your desktop so that you can find it easily later; wherever you save it, make sure that you can easily get to it when you need it) and click Save.

7. The Key Pair Information window lets us set up the details of the keys we are using to generate our certificate request.

8. Select 2048 as the key size and ensure that the Algorithm box is set to RSA.

Congratulations! The Certificate Signing Request file will now be saved. We can use this to upload to the Apple Developer Center to generate our iOS Developer Certificate.

2.8.2 Submitting the Certificate Signing Request for Approval

Once you have a Certificate Signing Request file, you are ready to upload to the Devel- oper Portal and to generate an iOS Developer Certificate.

1. Open the iOS developer site in your web browser (on your Mac) and click on the Provisioning Portal link on the upper right of the page.

2. On the left side of the window, click on Certificates to bring up the Create iOS Development Certificate page.

3. Click on the Choose File button. This will allow you to navigate your way to the Certificate Signing Request file we generated earlier. Find the file and select it.

4. Click on the Submit button.

Figure 2.3. The Keychain Access tool.

2.8. Setting Up the Certificates You Need for Development 41

The certificate will need to be approved before it can be downloaded. Once created, the status automatically begins at “awaiting approval.” Thankfully, it is you or your team who need to approve it, not any third party or Apple representative. Note that if your developer account was set up as an individual rather than a company, then you will be the only user and will have all the rights to approve the certificate. If your account was set up as a company, different roles may be assigned (such as team admin) to different users. Only those with team admin rights will be able to approve a certificate.

The certificate should have the “waiting approval” status. Go ahead and click on the Approve button. Sometimes it can take a little while to update its status, and you may have to refresh the page a few times before the certificate enters an approved state. Once approval is complete, a new link to download the certificate should appear. Download the certificate.

2.8.3 Installing the iOS Developer and WWDR Intermediate Certificates

Open the iOS Developer Center in your browser and click on the iOS Provisioning Portal link at the top right of the page. On the left side, find and click on Certificates.

Beneath your developer certificate is a message that reads “If you do not have the WWDR Intermediate Certificate installed, click here to download now.” Go ahead and click on the link to download the certificate. Once the file has downloaded, open it on your Mac. The Keychain Access tool should launch and install the certificate.

Now that we have the WWDR Intermediate Certificate, we need to go ahead and grab that iOS Developer Certificate. Staying on the Certificates screen of the Provision- ing Portal, find your certificate in the list (the one we created and approved earlier) and click on its Download link. Double click on the newly downloaded file to open Keychain Access and install it.

Assuming that you get through those steps error-free, congratulations! You man- aged to get through the hardest part of the setup. If you have trouble, Apple has an extensive help system and great support. Don’t be afraid to fire off an email to them if you are struggling.

Note that if you are part of a team, team members can only download their own iOS Developer Certificates. The Certificate Signing Request keys we generated earlier are unique to each machine, which means that your iOS Developer Certificate will only work on your machine. Other team members will be required to follow the process to make their own certificates.

2.8.4 Dealing with an Expired Development Certificate

Development Certificates are only functional for a limited time and you should keep an eye on the expiration date shown in the Certificates section of the Provisioning Portal. To continue development without interruption, you need to revoke the de- velopment certificate before it expires. To do this, go to the Apple Developer Center and click on the Provisioning Portal, then click to the Certificates area. Next to the expired certificate there will be a Renew button. Click it. The certificate will move to the “pending” status, so wait for a minute or so and then refresh the page. You, as team admin, can approve the request, which means that after the page refreshes, the status

should change to “active” and you should be able to redownload and install it to your development machine.

Một phần của tài liệu Game Development for iOS with Unity3D 2012 (Trang 56 - 59)

Tải bản đầy đủ (PDF)

(278 trang)