...
E. Setup Distribution Certificate and Provisioning Profile. Here are a graph that depicts the Provisioning Profile Process as generic blocks.
- Create a Certificate Signing Request (CSR)
- Use Keychain MacOSX application to generate one. This is needed to create a public and private key of your identity. It will be attached for you (the public part) to the certificate (next step).
- From Keychain Access menu choose Certificate Assistant and then Request a Certificate From a Certificate Authority
- Fill in only:
- User Email Address
- Save To Disk
- You'll need this file to attach it in step 2
- Use Keychain MacOSX application to generate one. This is needed to create a public and private key of your identity. It will be attached for you (the public part) to the certificate (next step).
- Generate a Certificate
- There are two types
- Developer - Used to distribute apps to developers and testers
- Distribution - Used to distribute apps to Apple Store or an Enterprise Distribution (ad-hoc)
- Click on Development link in the Developer portal to generate a Developer Certificate by uploading the CSR file generated in step 1.
- Once generation has finished, download it to your computer, to a folder where you can later clearly identify it
- There are two types
- App ID. A string that identifies the application that will be supported by the provisioning profile. Normally the App ID is the reversed company domain name with the app name at the end: com.shift2right.saleswarrior. If the app belongs to a group of other apps, the App ID should end with an asterisk: com.shift2right.* which will allow to sign several related apps.
- This string can be found in the bundle identifier in XCode:
- Go to Project Navigator and select the project name 'WasteManagementCRM'
- Click on General tab and find the bundle identifier as the first field on the detail editor
- On Developer portal, click on App IDs link and create a new one that matches your bundle identifier from XCode.
- This string can be found in the bundle identifier in XCode:
- Device UUID. In order to distribute the binary to test devices or to Enterprise devices, the provisioning profile must include device's UUID. You can collect these UUIDs by plugin in the device and either in XCode or iTunes check the UUID and add them in the App ID section. Membership includes 100 devices per year, renewable each year.
- Click on Devices in the portal
- Click on the PLUS sign (top right) to add one by one or in bulk from a formatted file.
- You won't be able to change UUID once submitted. You can change the name though.
- You can cancel a UUID and its slot will be available in 3 months.
- Provisioning Profiles
- There are two types
- Developer - Used to distribute apps to developers and testers
- Distribution - Used to distribute apps to Apple Store or as an Enterprise Distribution (ad-hoc)
- Click on Development and then the PLUS button (top right)
- Next, choose iOS App Development and click Continue
- Choose now the App ID for the app you'll be generating a provisioning for. Click Continue.
- Choose the Certificate you generated in step 2. Click Continue.
- Choose the devices IDs that will be included in the provisioning profile. Click Continue.
- Give it a clear and formatted name (highly recommended). I'd suggest something like [ADHOC_]<TYPE>_DDMMMYYYY
- [ADHOC] - Just an identifier that the provisioning profile is for AD-HOC deployment (Enterprise) or not
- <TYPE> - Could be DEV or PROD
- DD - day in double digits
- MM - abbreviated month name
- YYYY - year
- Once generation has finished, download it to your computer, to a folder where you can later clearly identify it
- There are two types
- Install them in your developer computer
- Open the folder where you downloaded your certificate (step 2) and the provisioning profile (step 5)
- Double-click the Certificate so XCode can install it
- Double-click the Provisioning Profile so XCode can install it
- Use the provisioning profile to sign an app. The Provisioning Profile contains now the CSR (your identity), the Certificate (public key), the App ID (bundle identifier) and Device UUIDs, so it's time to generate a binary and sign it with the provisioning profile to be able to install it on the devices:
- Plug-in a device to your Mac
- From the Schema pop-up (top left on XCode), select WasteManagementCRM_DEV, and then select the name of the device from the combo
- Choose Run from Product menu
- After building, XCode will choose the provisioning profile to run on the plugged-in device.
- Check that the provisioning profile was installed onto the device by going to Settings-->General-->Profiles
...