Translate

Tuesday, June 12, 2012

How to Submit Your App to Apple: From No Account to App Store, Part 1

This is a blog post by iOS Tutorial Team member Gustavo Ambrozio, a software engineer with over 20 years experience, including over three years of iOS experience. He is the founder of CodeCrop Software.
Learn how to join the Apple Developer program and get your app on the App Store!
Learn how to join the Apple Developer program and get your app on the App Store!
This two-part tutorial series will document every step of becoming an Apple iOS developer – from literally no account, to published on the App Store!
I’ll show you how to sign up for Apple’s iOS Developer Program, how to generate the various certificates needed, how to configure your app, and how to submit to the App Store for approval.
To create this tutorial, I created a completely new App Store account and submitted a new app to the App Store, keeping careful note of each step along the way.
The app I submitted to the App Store is an improved version of the app I built during my last tutorial series, How To Make a Catapult Shooting Game with Cocos2D and Box2D. The app, cute-a-pult, has already been approved and can be downloaded for free in the App Store.
For this tutorial, you will need US$99, a valid credit card, and a browser. And it may go without saying, but to develop apps, you’ll need a Mac computer, preferably with OS X 10.7 Lion installed.
Finally, you will need Xcode, Apple’s development software. You can download Xcode once you are registered as an Apple iOS developer. Which you will be, after the first few sections of this tutorial!
It will help to approach this tutorial with some patience and perspective. Becoming a registered iOS developer is a lengthy process and is sometimes repetitive. Just remember: in the end you will be able to submit your apps to the App Store for potential fortune and glory!

Getting Started

The first step on the path to the App Store is to register as an Apple developer. Note that becoming an Apple developer is free and is not the same as becoming an iOS developer, for which you must pay the aforementioned US$99 fee.
You may already have a developer account with Apple. If so, feel free to skip this section and move on to the next.
If you don’t yet have an Apple developer account, go to the iOS Dev Center and click the “register” link:

Click “Get Started”:

On this next page, you can choose to create a completely new Apple ID or use an existing one. If you want, you can save time and use the Apple ID you already use for your iTunes purchases, for example. But I’d suggest creating a new, clean ID. It helps ensure all your data is correct, and it keeps your personal and professional lives separate.
So, select “Create an Apple ID” and click “Continue”:

Fill in your email, password and security information. Use an email address that you check often, because Apple sends frequent updates on the program and on the status of apps you’ve submitted for approval.

Scroll down, fill out your personal information and click “Continue”:

The next page contains questions about your professional profile. There are no right or wrong answers to these questions. You don’t even necessarily have to select iOS as a platform, though of course it doesn’t hurt to be accurate:

Scroll down, fill out the rest and click “Continue”:

The next page is the “oh, so fun” legal agreement. Call your lawyer and read the whole thing to him/her on the phone. As soon as you get your lawyer’s approval, click the checkbox and click “I Agree.”

Almost done.

Check the email account you entered when registering. You should have received an email just like this. Click the link in the email or just enter the number in the final page of the registration process.

Cool, you’re an Apple developer! That’s great, but can you start developing apps and submitting them to the App Store? Well, not so fast… Click “Continue” and let’s give Apple some (more) money.

Joining the iOS Developer Program

Being a registered Apple developer gives you access to a lot of information, but to be able to send apps to the App Store (and to have access to certain associated portals) you need to enroll in Apple’s iOS developer program. This is the part that will cost you US$99 per year.
If you followed along with the previous section and clicked “Continue,” you should be in the right place. If you skipped the previous section because you already have an Apple developer account, then go to the Developer Member Center, log in, and you’ll be in sync.
Once logged in, click the “Join Today” link on the right of the page:

This next page is just a preview of the “what looks like 3 steps but is really 15″ process. Take a deep breath, make sure you have half an hour to spend, and click “Continue”:

Choose to use your existing Apple Developer ID and click “Continue”:

The next page asks if you want to enroll as an individual or as a company. For this tutorial, I’m enrolling as an individual, as this is what most of you will do. If you choose to enroll as a company the process won’t be as easy. You will need to submit a lot more paperwork to prove your involvement in the company.
If you do choose to enroll as a company, read the requirements on the right to make sure you have everything you’ll need.
Otherwise, just click the “Individual” button on the left, and let’s continue.

You’ll have to provide your newly-created credentials again. Fill out the form and click “Sign In.”

Enter your billing information to verify your identity. Apple will attempt to confirm this information with your credit card company, so make sure you enter it correctly:

Scroll down, fill in the remaining fields and click “Continue”:

It’s time to select a program. This tutorial series focuses on the iOS Developer Program, so that is the only option I will select. If you want to develop OS X apps, you can also choose to enroll in the Mac Developer Program, but this will cost you another US$99. (You can always sign up later, so don’t worry if you aren’t sure.)
Once you’ve selected your programs, click “Continue”:

Review your information, going back to correct any mistakes if necessary. When you’re ready to submit, click “Continue”:

Next we have yet another “oh so fun” license agreement. So call your lawyer again, get the OK to check the box and click “I Agree”:

Note: The following steps only apply to the US and other countries with online Apple Stores. For countries without online Apple Stores, the process will be slightly different, requiring you to fax your credit card information to Apple. Unfortunately, readers in those countries, you’ll be on your own for the remainder of this section. So, follow Apple’s instructions and meet me again in the next section.
For everyone still following along, click “Add to cart”:

This brings us to the Apple Store to continue the process. Click “Check Out Now”:

You’ll have to log in yet again. Use your newly created Apple ID.

You need to enter a “shipping address,” even though Apple is not going to ship you anything. I suggest you use the credit card billing address you entered previously (and will enter again shortly!). Fill out the form and click “Continue”:

Click “Continue” again:

Now enter your billing information and credit card number once again, and click “Continue”:

We’re almost done. The page you are on now might show estimated sales tax, as mine did, which you may or may not be charged (I was not). Once you’re ready, click “Place Order Now”:

You’re welcome!

Now, Let Me In!

After submitting and paying for your iOS Developer registration, you’ll need to wait a day or so for Apple to process your order.
If you had to fax your information to Apple because you’re in a country without an online Apple Store, you’ll need a little more patience. This was the case for me when I originally signed up, and it took a week for Apple to get back to me.
In either case, eventually you should get an email from Apple like this one:

At the same time, you should receive this email:

It is as this point that you should download Xcode, the main iOS development tool, if you have not already, using your new iOS Developer credentials. While we will only be using Xcode very briefly in this tutorial, there are many other excellent tutorials on RayWenderlich.com to teach you how to use it!
Now go to the iOS Dev Center and click “Log In”:

After providing your credentials, you’ll be in! Finally!
The iOS Dev Center has a LOT of information. There are programming guides, downloads, documentation, videos, the very helpful developer forum and a support center.
Spend some time exploring to familiarize yourself with what’s available. Be aware that some of this information might be confidential, especially if it involves beta versions of iOS or Xcode.
In this tutorial, we’re going to focus on two portals that you’ll use a lot when developing your apps, the iOS Provisioning Portal and iTunes Connect:

But first, a brief introduction to both is in order.
iOS Provisioning Portal
As we should all know, a non-jailbroken iOS device is only able to run apps approved by Apple and installed through the App Store.
Apple achieves this by requiring that every app run by iOS have a signed Apple Certificate. Apps installed from the App Store come bundled with a certificate, which the system verifies before it allows the app to run. If there’s no signature or if the signature is invalid, the app won’t run.
As developers, we need to be able to run our apps on our devices on a regular basis as we’re developing them. For this we need a way to create and sign our own certificates.
That’s where the iOS Provisioning Portal comes in. The portal allows you to generate what Apple calls “profiles.” Profiles, sometimes called “code signing identities,” are files generated by the portal that allow Xcode to sign your apps in a way that your devices’ iOS will identify as valid.
There are two types of profiles:
  • Development profiles. These are tied to specific devices, so the app can only run on those devices.
  • Distribution profiles. These are used to sign your app before you submit it to Apple for approval. They contain no device-specific information, but you can’t use them to install apps on any device yourself, because Apple still has to sign the app after the approval process.
The Provisioning Portal can also generate push certificates in case your app wants to send push notifications (think: pop-ups sent from your server when something occurs).
iTunes Connect
iTunes Connect is the portal you’ll use to submit your apps. This is where you’ll register a new app, enter the app’s description and screenshots, choose the price, and configure game center and in-app purchases.
This is also the portal you’ll use to agree to new contracts, set your financial data (so you can bank that profit) and check your sales.
We’ll spend the rest of this tutorial using the Provisioning Portal. Next time, in Part Two, I’ll introduce you to iTunes Connect.

Certificates, Device Registration, and Profiles

In this next part of the tutorial, we’re going to use the iOS Provisioning Portal to set up the information we need in order to deploy our app to our device (and later the App Store).
Note that there is a simpler way to do this in Xcode called Automatic Device provisioning, that we will cover in part two of the series. But for now, I’m going to take you through the process step by step. You’ll understand how things work better this way, which is especially important information to know when submitting to the App Store.
If you still have your iOS Dev Center page in front of you, just click the link on the upper right, or go here:

There are a lot of things you’ll need to do from this portal. Some of them you’ll only have to do once, like generating your certificates and registering your devices. Other things you’ll have to repeat for every app you make, like generating development and distribution profiles.
First you’ll need to generate two certificates, one for your development profiles and another for your distribution profiles.
Let’s click on the “Certificates” link to get our certificates:

Click “Request Certificate”:

The next page explains how to ask for a certificate. I’ll guide you through the process.
Let’s leave the browser for a little while and open the Keychain Access app on your Mac. If you don’t know where it is, search for it using Spotlight:

Once the program is open, from under the Keychain Access menu choose “Certificate Assistant,” then “Request a Certificate From a Certificate Authority…”:

In the Certificate Assistant window, fill in your email address and name, choose “Save to disk” and click “Continue”:

Save the file somewhere on your Mac.
Go back to your browser, find this file using the “Choose file” button and click “Submit”:

Apple will take some time to generate a certificate for you. I’ve seen it take a few minutes, but sometimes it can take a lot longer. While we wait (the status might say “Issued,” but the certificate isn’t actually ready until a download button appears), let’s do something else we need to do anyway.
You should see a message at the bottom of the “Current Development Certificates” section that says, “If you do not have the WWDR intermediate certificate installed, click here to download now.” Click that link.

This will download a file called AppleWWDRCA.cer. Double-click this file to install it. It will open Keychain Access again in case you closed it. Once the file is installed, keep Keychain Access open because we’ll need it again in a few minutes.
You’ll also need a distribution certificate. Click the “Distribution” tab and submit the same certificate signing request as for the development certificate. I’m not a security expert, but I think reusing the same certificate signing request in this case is not a big deal. Feel free to correct me if I’m wrong.
Again, it sometimes takes a while for the certificate to become available for download. We need both certificates to continue, so if you’re still waiting, go get a coffee or peruse another great tutorial on the site, and come back later.
Once both are ready, click the “Download” button under the Development and Distribution tabs to get both certificates.

Double-click both files to install them in your keychain. You should see your certificates as follows:

Now you can close Keychain Access.
Let’s continue. The next step is to register our devices. On the left-side menu, click “Devices” and then on the right, “Add Devices”:

You need to get the UDID of the device(s) you want to use to run your apps. There are many ways to get a device’s UDID: there are free apps available that will do it for you, or you can use Xcode’s organizer. I’ll show you how to get a UDID using iTunes.
Open iTunes and plug the device into your computer. Select the device from the left-side menu. iTunes will display your device name, capacity, version, serial number and phone number. Click on the serial number and it will change to your device’s UDID:

Now just use CMD-C to copy the UDID to your clipboard.
Go back to your browser, enter a device name and paste the UDID into the appropriate field. The device name can be anything you want. To register additional devices, click the “+” button. When you’re done, click “Submit.”

You can always go back later to register more devices, such a those belonging to friends and beta-testers. Apple allows you to register up to 100 devices per year to your account. (Note that if you register a device and later remove it, it still counts towards your total for the year.)
Now that our device is registered, we need to register an app ID. Every app you build will need its own app ID. Click “App IDs” on the left-side menu:

You’ll see a detailed explanation of the app ID concept. In a nutshell, an app ID is a combination of a 10-character “seed” prefix generated by Apple, and a bundle ID created by you. Together they create a unique identifier for your app.
Here are some important things to know about app IDs:
  • You can elect to have all of your apps share the same seed prefix, if you want to share keychain information between them. Say you have a suite of apps that all make use of the same website via a login. If the apps share the same seed prefix, and one app saves the user’s login information to the iOS keychain, any other app in the suite can get this login information from the keychain.
  • The bundle ID has to be unique for each of your apps. It will be used by Apple’s push service for in-app purchases and for iCloud storage.
  • Apple recommends that you use “a reverse-domain name style string” for the Bundle Identifier portion of the app ID. The suggested format is “com.domainname.applicationname.”
  • Apple does allow you to use an asterisk character to create a “wildcard” bundle ID that can be used across all your apps, but I don’t recommend this approach.
    Using an wildcard may make it easier to create provisioning profiles, but you won’t be able to use push services or in-app purchases. You might not plan to use these services now, but if you change your mind, you won’t be able to change your app ID without creating a new app.
Now that you know all about app IDs, let’s create one. Click “New App ID.”
Fill out the description (usually just your app’s name) and the bundle identifier. The seed ID will always be your team seed ID. (In the past there was a way to have more than one seed ID, but this seems to have been disabled.)
Remember to use a reverse-domain name style string for your bundle ID. Click “Submit” when done:

Now we’re ready for the last step (for now) inside the Provisioning Portal: creating the provisioning and distribution profiles.
Click “Provisioning” on the left-side menu and “New Profile” on the right:

Fill in your app’s name as the profile name, select the certificate, choose the app ID you just created, and finally select the devices you want to use to test your app. Click “Submit”:

When you return to this page, the status of your profile will be “Pending” as Apple generates the file for you. Usually if you just click the “Development” tab again, you’ll see your status has already changed to “Active” and a “Download” button has appeared.

Before we download the file, let’s go ahead and generate the distribution profile. We won’t actually need the distribution profile until we’re ready to submit the app for approval, but since we’re here, let’s do it now.
Click the “Distribution” tab at the top of the page and click “New Profile.”
Choose “App Store” as the distribution method, enter a profile name (can’t be the same name you used in the development profile), choose your app ID and click “Submit.”

I won’t go into detail here about Ad Hoc distribution, since distribution is not the subject of this tutorial. You can learn more about Ad Hoc distribution here.
Your provisioning profile should be ready. Go back to the “Development” tab, click “Download” and save the file to your computer. Do the same for your distribution profile by clicking the “Distribution” tab and clicking “Download.”

Now find the files you just downloaded on your computer, and double-click them. They should open in Xcode’s organizer:

No comments:

Post a Comment