Tutorial: How to use AppSync Unified for development with Xcode
So, many of you have requested a tutorial on how to use AppSync Unified to develop your own iOS apps with Xcode. As you all may know, it costs $99 per year to become an official member of the iOS Developer Program. Some people may not be able to afford this fee, usually due to their age (like myself). This is for those people who want to develop iOS apps and test them on their own device, but lack the funds to do so.
Or if you're enrolled in the iOS Developer Program already and you're just lazy, following the steps here will allow you to develop apps without provisioning :P
- Download Xcode if you haven't done so already.
- After Xcode has been installed, download patch-ios-sdk.
- Open a Terminal instance, make "patch-ios-sdk" executable and run it (example: "cd ~/Downloads; chmod +x patch-ios-sdk; patch-ios-sdk"). Note: when it asks you for your password, it is normal for it to not show the password as you type it.
- Open Xcode and let it do its initial setup, then quit Xcode.
- Open Keychain Access, click on the Keychain Access item in the menubar, go to Certificate Assistant, then "Create New Certificate"
- Enter your name in if OS X didn't already fill it in, change Certificate Type to "Code Signing" and check "Let me override defaults"
- For the serial number, bash your head into your keyboard a bit. Or just leave it at 1, it doesn't really matter.
- Change the validity period to something longer than one year (or if you really want, you can just leave it at 365 days).
- Then just click Continue for the rest of the steps until you have a shiny new certificate.
- Quit Keychain Access, and open Xcode.
- Either create a new Xcode Project, or open an already-existing one.
- Download asu_pid.entitlements and add it to your Xcode project.
- On the Xcode sidebar, click on the project, and go to "Build Settings."
- Scroll down to "Code Signing," and change all the options under "Code Signing Identity" to "Ad Hoc Code Sign."
- Then change "Code Signing Entitlements" to "YOUR_PROJECT_NAME_HERE/asu_pid.entitlements" (no quotes) — assuming that you placed asu_pid.entitlements inside your project folder.
- Either repeat changing the build settings in the Test target, or just delete the Test target.
- Select your iOS device from the dropdown in the Xcode toolbar, and run your app.
- Have fun developing.
Some ending notes
- You will need to re-run "patch-ios-sdk" every time Xcode updates with a new version of the iOS SDK. Just remember to do that.