Back in 2008, the Apple App Store was launched for the iPhone. Fast forward to today and the App Store makes more money than Hollywood! Those early developers in the App Store were not only pioneers, but they also became millionaires.
Of course, hind sight is 20/20, but what if I told you have an opportunity to do it again – to be a pioneer in a new era of mobile devices. No, I’m not talking about the iPad… the vision for this is way bigger! I’m talking about the Apple Watch. It isn’t the first smart watch, but the iPhone was neither the first smart phone. Like it or not, Apple knows how to revolutionize the industry and they are doing it again with smart watches. Now you have a chance to be among the first!
Watch App Store
There is a new section in the App Store for the Apple Watch and there isn’t millions of apps. It’s clean as a slate and waiting for developers to pour into it… now is the time.
Submitting apps to the App Store has always been a grueling process though – from certificates, to identifiers, to provisioning, to device UDID’s, yuck. It’s almost as painful as bookkeeping for taxes.
So today, I’d like to show you the steps in submitting your shiny new watch app to the App Store. If you done this before with the iPhone, the steps are similar. However, there are slight differences with Apple Watch and also the latest Xcode 6+ makes this a bit easier with some automation.
Show Me the Steps!
Step 1: Create certificates
First step is to create a production and a development certificate. Although this is annoying, you will only have to do this once ever per machine you develop on. Then it is used for all your apps going forward.
Log into https://developer.apple.com and click on the “Member Center” menu item. From here, click on “Certificates, Identifiers & Profiles”. Click on “Certificates” link under the iOS Apps section. Phew… are you still with me? The page should look like this for you:
Cool, now in the middle of the page, click the “+” sign to add a new certificate. From here, you will simply follow the wizard and instructions to create your certificate. Do this once for Development > “iOS App Development” and another certificate for Production > “App Store and Ad Hoc”.
Once you finish the wizard, download the *.cer file and double-click it to make sure it opens on your Mac. It should open your Keychain Access app on your Mac and see your new certificates with private keys:
Remember, these certificates should only be created once per machine, not per app! So now you will never have to do this again when submitting more apps (unless you get a new machine).
Step 2: Add your Apple ID to Xcode
If you haven’t done this already, add your Apple ID to Xcode > Preferences > Accounts. This way, Xcode will be able to automatically make changes to your Certificates, Identifiers & Profiles when it needs to. Trust me, I’d rather Xcode make changes it needs than bang my head against the keyboard for hours. It should look something like this:
Of course, this also only has to be done once per machine, not per app (unless you are submitting apps to multiple different Apple ID’s).
Step 3: Create your project
Next is to create your app in Xcode. If you haven’t created an Apple Watch app before, be sure to check my other post.
Step 4: Add capabilities to your project
Sometimes you cannot foresee this, but try to add some basic capabilities you are sure to use. Click on your project from the file list, then in the middle select the target you’d like to apply this to. Then click “Capabilities” across the target menu (where it says General, Capabilities, Info, Build Settings, etc) and activate what you need.
Most likely, you will need to add App Groups to store data between the watch and phone. When you activate this, Xcode will ask you which account you would like to enable App Groups for. This is the account you set up in the previous step. Select the account to activate it for when Xcode pops up this window:
Don’t forget to enable what you need from the WatchKit Extension target too!
Now press Command+B to make sure the project builds.
Step 5: Creating the Provisioning Profiles
If you got to this point, Xcode created a bunch of stuff automatically for you. It create the App ID’s:
And the provisioning profiles:
Noticed it created one for the iPhone part of the app and another for the WatchKit extension. However, these provisioning profiles are for development, not distribution. So back in you Certificates, Identifiers & Profiles section in you Apple Developer > Member Center area, click on “Provisioning Profiles” and click the “+” sign to add a new one. Be sure to select Distribution > “App Store”:
Go through the wizard and select the App ID that Xcode created for you:
For the profile name in the “Generate” section of the wizard, this can be any name but I suggest adding something like “Unit Watch App Store” so you know this provision is for the App Store and not for development. At the final step, download the generated provisioning profile and double-click it. It will open Xcode; although it doesn’t seem like it did anything, it added the entry to your list of provisioning profiles so you can adjust build settings later.
Do this whole step again but for the App ID with the .watchkitextension suffix, and name this profile something like “Unit Watch WatchKit App Store”.
Step 6: Adjust the Build Settings
You’re almost there. Now it’s time to take what Xcode created for you in your developer account and apply it to your project. In the folder list in Xcode, highlight your root project, then in the middle highlight the project, then click on Build Settings. Make sure “All” is selected. Then go to the “Code Signing” section. From there, under “Provisioning Profile”, select the one that applies to this project (without the “.watchkitextension” suffix). Then select “Automatic” for all the other sections in that section. Your screen should look something like this:
Now do the same for the iPhone target:
And now for the Tests project, but this will be a bit different. Select “Automatic” for the provisioning profile, then “iOS Developer” for the rest:
Then for the WatchKit target, select the provisioning profile with the .watchkitextension suffix and select “Automatic” for everything else:
And one more time for the WatchKit App target, except choose “Automatic” for the “Provisioning Profile” and “iOS Distribution” all the other fields:
Finally, update the Info.plist file in the iPhone target to have the actual Bundle identifier (which is actually the value you entered when you created the project in Xcode):
Step 7: Preparing your build
Now we are ready to package it up to prepare it for the store. Change the build scheme to “iOS Device”:
Now in the top Xcode menu (where there is File, Edit, View, Find, etc), go to Product > Archive. This will create a new build package for the App Store for submission. You should get a new window with your archive with some options:
Step 8: Create your iTunes Connect App
Before we can validate, we’ll need to create the app in iTunes Connect. This is where you manage all your App Store products. Go to https://itunesconnect.apple.com and click on “My Apps”.
Click on the “+” sign and create your new iOS App and select the right bundle ID without the .watchkitextension. The version must match the version in your Info.plist and the SKU can be anything you want, but I use the bundle identifier since I know it is unique.
Step 9: Validate your build
Now comes the moment of truth. Go back to Xcode and click on validate in the archive window. You should get this popup, click “Validate”.
Wait for butterflies to tickle your stomach, then WHAAMMMM!!! Hopefully you should get this soothing screen:
Congrats for an awesome achievement. If you didn’t get this far, no worries, it’s a grueling process! Just search the web for the error message and you may find a way out.
Step 10: Submit to App Store
What’s nice about these steps is I usually do this with a fresh new project, before even writing a line of code. That way, everything is ready for me after I code the app. When your app is finally ready, just go back to Product > Archive and generate a new build, then validate, then “Submit to the App Store”.
Now in iTunes Connect where your app details page is, look for the “Build” section. Click on the “+” sign to add the build you just uploaded. Also, be sure to fill in all the blanks like description, keywords, etc, especially the new Apple Watch section that you have to put some icons in:
Click save and then “Submit for Review”. Now await for the approval process which, at this point, only took me 3 days. It seems they’ve put a high priority on watch apps for the time being or maybe the watch app submissions haven’t poured in yet.
Stay tuned for more WatchKit posts…
Can you explain how to send in the build? You say there is a plus Sign but I don’t see it anywhere.
Dose the app bundle identifier same whit the watchkit bundle identifier???
No it is different, so append “watchkit” or something similar to the end of the original app bundle id.