Appendix C. Publishing your SDK program

All of your programming will be for naught if you don’t sign up for the iPhone Developer Program with Apple. This is a multistep process that can take quite some time, so make sure to get it all in hand well before you want to upload your program to the iPhone App Store.

C.1 Signing up with Apple

To get started, you must register as a developer at developer.apple.com/iphone/program. When you register, you’ll be asked for some basic information about what you’ll be developing and you’ll need to sign Apple’s Terms & Conditions for working with the iPhone. You’ve probably already done this step, as it was required to get access to the SDK and the online documentation.

Sometime afterward—maybe in a few hours, maybe in a few weeks—you’ll get a call from Apple confirming your signup information and giving you the OK for the program. They’ll then send you an email that’ll allow you to finish your registration. At this point, expect to pay a fee, currently $100 (standard) or $300 (enterprise), to become a full-fledged developer. The standard program allows for distribution via the iPhone App Store, while the enterprise program allows distribution of in-house applications to over 500 employees.

C.2 Compiling to the iPhone

The first advantage of being a registered iPhone developer is that you’ll be able to compile programs directly to your iPhone. This is fairly critical for certain types of testing. As we’ve seen in this book, features like altitude detection, volume control, and the accelerometer don’t work correctly when tested in the iPhone Simulator.

To compile to an iPhone, you must create a provisioning profile, which is a multstep process. You’ll need to use some new tools that will appear under a Program Portal link at the top of developer.apple.com once you’ve finished your signup and paid your fee. Apple has a complete “iPhone Developer Program Portal User Guide” that explains how to use everything here, but we’re going to outline the main steps:

1.  

Add team members (admin)— If you registered as a company, you can add additional team members under the Team tab. The initial creator of a team will be the Team Agent, who has the highest-level powers in the Developer Program; other users will be Team Administrators or Team Members. From here, individual members can set themselves up to compile to their iPhones, with some steps requiring interventions from Team Admins.

2.  

Create a certificate signing request (member)— This is the first step required to generate the certificate you’ll need to sign (and thus run) applications on your iPhone. You create a certificate signing request (CSR) inside Keychain Access on your Mac and then upload it from the Certificates > Development tab; a Team Admin must then approve it.

3.  

Download a certificate (member)— Once your Admin (who might be you) has approved your CSR, you can download a certificate. From Certificates > Development, download the WWDR Intermediate Certificate and double-click to install it. Afterward, download your developer certificate and double-click to install it.


Warning

Your certificate will now be permanently installed in your keychain. However, if you rebuild your machine or move to a new machine, you’ll lose it. To avoid this, be sure you export the private key associated with your developer certificate. You can then import it on a different machine, and redownload the two certificates from Apple. If you fail to do this, a Team Admin may need to revoke your certificate so that you can create a new one.


4.  

Add devices (admin)— Add any devices (iPhones or iPods) that you want to build on using the Devices tab.

5.  

Create an app ID (admin)— Each application needs an app ID, which controls its access to devices. For the purposes of testing, you’ll probably just use one general wildcard ID that you create by appending a wildcard (.*) to your app ID bundle identifier.

6.  

Create a provisioning profile (admin)— A provisioning profile is a unique combination of multiple developer certificates, multiple iPhone device IDs, and a single app ID. It’s what ties your iPhone to your overall development profile and what allows you to actually run programs. You create a provisioning profile from the Provisioning > Development tab, at which point you’ll be asked to enter the three elements that make it up.

7.  

Download a provisioning profile (member) — Download the profile from Devices and drag it your Xcode dock icon or the organizer window of Xcode.

Though the setup can be a bit extensive for an admin, once the initial work is done, a member can just create a CSR, download a certificate, and download a provisioning profile. From that point, the member can choose to compile onto a device rather than to the iPhone Simulator by changing the pop-up window at the top-left of Xcode.

C.3 Preparing for distribution via the iPhone App Store

Preparing your program for distribution via the iPhone App Store follows much the same process as preparing your programs for testing on iPhones, except that the steps can only be undertaken by the Team Agent.

1.  

Create a certificate (agent)— As before, you must upload a CSR, but here you should create a certificate from the Certificates > Distribution tab, rather than Certificates > Development.

2.  

Create a provisioning profile (agent)— Create a provisioning profile in the Provisioning > Distribution tab. It will usually be an App Store profile. As before, drag your new profile to Xcode.

3.  

Prepare to compile (anyone)— Create a new Distribution configuration that uses the distribution provisioning profile. Update other info in the configuration, update your Info.plist as appropriate, and then build.

4.  

Prepare media (anyone)— Prepare a 57x57 PNG home screen icon, a 512x512 JPG/TIF large application icon, and a full-screen screenshot, as well as other information required by the iPhone App Store.

5.  

Upload (agent)— Go to the Distribution tab and run iTunes Connect.

6.  

Wait (everyone)— It’ll take a bit of time for your application to be approved and go on sale.

These procedures may well change over time, but for now, this should be what you need to get your program from your desktop to the iPhone App Store.

There are also two alternative ways to distribute your software: enterprise distribution lets you distribute an in-house application to employees within your company, and ad hoc distributions let you distribute to up to 100 other iPhone users by email or a website. Both are explained further in Apple’s documentation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset