So you’ve heard the great news and downloaded Flash Builder 4.5.1 supporting iOS, what now?! The process to become an iOS developer with Apple can be a bit daunting. This post is intended to help make the process easier and more understandable for those looking to develop applications for iPhone, iPad etc. My best advice before diving into this is to try not to get too caught up in the jargon and just follow the required steps. I put a short summary of iOS terms and their meanings at the bottom of the post. There are also more links there, including some Apple programs to check out such for your apps such as push notifications, and a section detailing the AIR app-descriptor XML specific to iOS.
You could avoid the rest of this post and still create an application in Flash Builder 4.5.1 with an iOS target and simply use the emulator if you just want to get a feel for what Flex Mobile for iPhone/iPad is like before going through the process. When you feel you are ready to try your application on an actual device though, there are two files you will need to have obtained from Apple, a code-signing certificate and provisioning profile. Here’s a dialog from Flash Builder 4.5.1 specific to an application being targeted for iOS. You can see that two files are required to continue and this post details the steps required to obtain those:
Note: You can use Flash Builder 4.5.1 or CS5.5 to package an iPhone or iPad application, but Apple basically requires you to have access to a Mac or use a Mac to create the necessary certificates with the Keychain to use for uploading your application to the app store. If you’re a Windows user you should see this link on generating a certificate and use that to replace the steps below where the Keychain Access utility is used on Mac. This post has some information that might also be useful to Windows users.
Apple Developer Steps
2-Select Program Contract
3-Setup Certificates/Devices/Provisioning Files
Note: Apple Developer Steps 1 and 2 will be done prior to any application phase, Step 3 will be used in each application phase.
Start here to enroll in the iOS Developer Program. The Apple Developer Center will walk you through the necessary steps to either create a new Apple id for an individual or company, or use an existing Apple id but add the iOS developer program to it (for instance if you’re already developing for Mac OS X). On the ‘Select a program’ step, choose ‘iOS Developer Program’.
Note: When signing up as a company versus an individual, the enrollee will be designated the ‘Team Agent’ and can invite more team members and assign team admins. Those steps are beyond the scope of this post, refer to the Apple iOS Developer’s guide for more details. When you register as an individual, your name will be listed as the seller of any apps you submit to the app store. If you register as a company, your company’s name will be used.
(should be within 24-48 hours or sooner when registering as an individual)
Free Applications Contract – You will automatically be eligible to develop applications for iTunes that are free. This contract is managed through iTunes Connect, which you will receive an email from with a link and can login to using your Apple Developer id set up in the enrollment step.
Paid Applications Contract – You need to complete a separate contract through iTunes Connect for applications you are selling including your bank info (where to distribute proceeds and deduct payments), a W-9 tax form and contact information. Note: don’t worry about this step if you’re just wanting to start playing around with some application dev’t and testing, you can always go back and update it later.
These are needed during application development, testing and distribution (explained next…)
This section explains how to use the Apple iOS Provisioning portal to develop and test an application on one of you devices but NOT distribute (distribution is covered in the next section):
This step is probably the most confusing or painful part of the process of developing for iOS, but this info should help explain what you’re doing and why.
Once you have your contracts in place in iTunes Connect, you want to log in to the Apple Developer Center with the id you created in the registration step to set up any devices you’re using and obtain provisioning profiles and certificates to use in development and distribution. Once logged in, click on iOS Provisioning Portal.
TIP: The Apple Developer Center iOS Provisioning Portal has a ‘How To’ tab in each section that gives more detailed information on each step of the process below and I highly recommend using it as you’re going through these steps.
• Request, Authorize and download iOS Development Certificates
• Designate Apple Devices for your Development Team
• Create unique App IDs for your Applications or create a wildcard app id to use for a set of applications
• Create and Download a Development Provisioning Profile
1) Request and authorize an iOS developer certificate – required for code-signing your applications
An iOS developer certificate is required to sign your applications, for instance you will be asked to supply it in packaging step of the development process in Flash Builder 4.5.1. On your Mac (OS X 10.6 or higher) run the Keychain Access application by going to Applications -> Utilities -> Keychain Access. Go to the top menu and select: Choose Keychain Access -> Certificate Assistant -> Request a Certificate from a Certificate Authority. Enter the email address you used in your Apple developer registration and leave the CA email address blank. Your screen should look like this:
next you will be prompted to save the file to your hard drive. Make note of where you saved this file. Then on the Key Pair Information panel, just leave the defaults of 2048 bits and RSA and press ‘Continue’.
(Windows Users: use this link to generate your certificate)
Now go back into the Apple Developer Center web page where you’re logged in to the iOS Provisioning Portal and click the ‘Certificates’ option on the left:
Now towards the bottom of the screen, click ‘Choose File’ and find that certificate signing request (CSR) file you just created from your Keychain Access application and press Submit. The certificate will show up in the list now with a status of ‘Pending Approval‘. Since you’re registered as an individual, you will need to just go in and approve your own certificates by clicking the ‘Approve’ button.
Next you need to download your newly approved developer certificate (.cer file) and the WWDR intermediate certificate (don’t worry about what this is, just download it from the supplied link next to the * note below your list of certificates). Once downloaded, double click each of them from your Mac and they will automatically cause Keychain Access to open, where you will choose to Add/Install them to your login keychain.
2) Register devices
This step requires you to use the portal to enter the UDID (Unique Device ID) of any devices you plan to have your application tested on, up to 100 of them per year. Once they have been provisioned they are included in the count for that year, regardless of whether you remove them. To get the UDID of a device, you can use iTunes with your device plugged in and locate the Serial ID on the Summary Tab and click on it. You will see it change to a 40-character UDID number, copy this number for the portal. Note: DO NOT USE THE SERIAL NUMBER, it will not work!
3) Create a unique app id
An Apple App ID is made up of a 10 character Bundle Seed ID (generated by apple) and a Bundle Identifier (specified by the developer). The Bundle Seed ID is generated by apple, and it a combination of letters and numbers. For instance, A12BC3D45E. You need to register your App ID to use specific Apple features such as the Apple Push Notification service (APNs) and to register an application to incorporate In App Purchases. Wildcard bundle identifiers are a good way to start with developing for iOS because it can be used to build and install all of your applications. You can generate a wildcard app id in the provisioning portal. An example of a wildcard to be used with all applications would look like: L2R24EVPME.*. If you create one for a specific application, use the reverse domain name approach for the bundle identifier. So something like L2R24EVPME.com.devgirl.myfirstapp. for instance.
4) Create and download a Developer Provisioning Profile
A provisioning profile is required for testing your application on any iOS device and is basically a legal entity binding you as an authorized developer to a developer certificate, device id (or list of device id’s) and application. You will be using the same developer certificate that is correlated to this provisioning file to code sign your application. I have a personal tendency to need to understand things to the Nth degree and don’t like to just assume what I read. I thought the best way to understand what this file contains and is used for would be to just open it up and look at it. I opened it in a text editor and saw all of the information it contained, and thought it may help to show some of that data in this post too:
<key>DeveloperCertificates</key> <array> <data> FIIMYzCCBEugAwIBAgIIA3dPnIKEeV8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJ BgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBs BSZXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBw iCNAgY+HfCq5WHCPM+4mDTUZDCrzYylgAVbk75aJziP6 </data> </array> <key>Entitlements</key> <dict> <key>application-identifier</key> <string>L4DHMAGNR9.*</string> <key>get-task-allow</key> <false/> <key>keychain-access-groups</key> <array> <string>L4HDANMGR9.*</string> </array> </dict> <key>ExpirationDate</key> <date>2079-07-02T20:05:40Z</date> <key>Name</key> <string>HollysJune2011DistributionCertificate</string> <key>ProvisionedDevices</key> <array> <!-- the following are the device UDID's for which this provisioning profile can be used --> <string>70193d04350b256bfa369030b9e3017e5fefa31b</string> <string>323bdcefb416202352646a241d232dfed3b71be2</string> <string>4891caf07e97827b622f06b2f776d8163a3c082b</string> <string>cg3ba2c52857063b36392899a78fc535c4770fe9</string> <string>25ecde32aad52da6174a89fa672e81acdd74a1be</string> <string>0mffb312e9abb5bf1b0d7d6fa7de558fa22e9a51</string> </array> <key>TimeToLive</key> <integer>24855</integer> <key>UUID</key> <string>B154BFFB-DAF6-4E8B-861A-B51E818EA2FA</string> <key>Version</key> <integer>1</integer>
Tip: If you get an error in iTunes when trying to install an app saying that the Signer is not Valid, it’s probably because you did not re-generate your provisioning file again from the portal after adding your device UDID. You also need to make sure the application is built with that new provisioning profile (Flash Builder asks you for it).
Note: Any given device may contain numerous provisioning files tied with different certificates, device and app id’s. You should also realize you will be creating multiple provisioning files, so you should get used to this step. Each development provisioning profile expires after 90 days. The distribution provisioning profiles expire later, see the Distribution section for details.
Remember, the above steps will only allow you to test an application on your own devices. You need to go through the next set of Distribution steps to distribute your application to others for testing or for final distribution of your application.
You will use the same sections in the portal as you did in the Development stage, except this time you will be selecting the Distribution tab within those steps where applicable, as well as the final Distribution section.
Many of these steps are similar to what you did in the development phase so less detail is needed in this section. The most important thing to note here is that there are two different types of distribution phases, Ad Hoc and App Store. Ad Hoc just means distributing your application to a limited set of people for testing on their devices (limited to 100 devices). The App store distribution phase is the final distribution phase where you’re application is ready for the iTunes app store. The two phases each require their own provisioning file, just as the development phase required a development provisioning profile. The application must be rebuilt with this new provisioning file after it’s created and downloaded before it can be distributed.
NOTE: You will see a note in red that says: ‘Only Team Agents are authorized to prepare and submit applications for distribution.’ – don’t worry, you are your own Team Agent since you signed up as an individual
1. Create a ‘Distribution’ Certificate to sign your application for distribution to others. This is the same sets as creating the Developer Certificate above, do the exact same thing but use your company name this time if you want, this is the one that will be used to sign your apps for others. Your developer certificate can only be used for development and will expire, or could be revoked before expiration. The distribution certificate is valid for one year. It can be used to sign your application for distribution.
2. Register any device id’s for those users who you are designating as testers. You must do this step before generating your provisioning profile, to ensure the device id’s are included in the provisioning profile you will associate with your application in Flash Builder. Note: You can continue to add more device id’s up to 100, you just have to remember to re-generate the provisioning file created in the next step and download that to use with your application.
3. Create a Provisioning Profile for distribution – you will need to select from either Ad Hoc (to distribute to people for testing) or App Store Provisioning Profile to use for your final release to the iTunes App Store depending on your stage of development.
4. Rebuild your application with your new distribution provisioning file and distribution certificate in Flash Builder. You can use the Flash Builder – File | Export | Release Build (under Flash Builder in the Export dialog) option to do this. Here’s an example of the dialog for iOS when you select to do a release build:
5. Ad Hoc Distribution – If you’ll be distributing your app for testing, you could then post the resulting package .ipa file to a website or send via email to your testers.
App Store Distribution – If it’s an app store ready distribution package, then you will use the iTunes Connect site to submit your application. You’ll need to fill out a bunch of information, be as explicit as possible to avoid issues with rejection. Upload your application on the Upload page as a renamed .zip file and upload the 512×512 image separately as the large icon. This will be used for your application presence in iTunes.
Bundle Seed ID – the Apple generated 10 digit id portion of your AppID
Bundle Identifier – the developer provided portion of your AppID (reverse domain name or * for wildcard)
Provisioning Profile – a file that gets installed to the device and links you (via your digital certificate) with an Apple iOS registered id, list of device id’s and application id plus some other metadata.
Ad Hoc Distribution – ‘test provisioning profiles’ – Share your application with up to 100 others via email, or by posting it to a website or server. A specific type of ad hoc provisioning file is used when you build your installer package in Flash builder that includes the registered device id’s of your testers.
Code-Signing Certificate – a .p12 file used for code signing your applications. It gets installed to your keychain (Mac thing) after download from the provisioning portal and is one of the items you’ll need to specify in Flash Builder when you build your installer package, along with your provisioning profile. Also referred to as a developer certificate or distribution certificate.
Information Property List (info.plist) – Contains settings and configuration data information for your iOS application. Similar to the app-descriptor XML file for AIR. The iOS section in the AIR app-descriptor will use the key/value pairs specified in the infoAdditions element. See this link for more details about which values can be specified here.
Keychain – on your Mac, it’s a password management system tied to your Login id/pw that holds encrypted keys of data.
UDID – a unique 40-character identifier for your Apple device.
AIR app-descriptor iOS-specific notes:
There are certain icon sizes needed specifically for iOS. At the time of this writing, the app-descriptor created when you build a new Flex Mobile project that includes an iOS target does not include XML tags for all of the sizes used for iOS. For instance, you will want to specifically specify these sizes:
Note: The 512×512 icon is NOT included in the packaged installer (.ipa file) that’s used to submit to the app store, you submit this icon separately as a jpeg. It is however included in the development and ad hoc packaged installers generated from Flash Builder but you should specify it as a .png in the app-descriptor. See Icons for app descriptor notes for more details!
There’s also a section in the AIR app-descriptor XML file specific to iOS that you need to be aware of that can be used to change some application settings corresponding to the iOS Information-property list (application config file for iOS, aka info.plist file). Here’s an example of some values that could be set in this section:
<!-- iOS specific capabilities --> <iPhone> --> <!-- A list of plist key/value pairs to be added to the application Info.plist --> <InfoAdditions> <![CDATA[ <key>UIDeviceFamily</key> <array> <string>1</string> <string>2</string> </array> <key>UIStatusBarStyle</key> <string>UIStatusBarStyleBlackOpaque</string> <key>UIRequiresPersistentWiFi</key> <string>YES</string> <key>UIApplicationExitsOnSuspend</key> <string>YES</string> <key>UIRequiredDeviceCapabilities</key> <array> <string>microphone</string> <string>gps</string> <string>camera-flash</string> </array> ]]> </InfoAdditions> <requestedDisplayResolution></requestedDisplayResolution> </iPhone>
The UIDeviceFamily specifies what iOS devices the application can be run on. The 1 value refers to the iPhone/iTouch and the 2 value refers to the iPad.
<key>UIDeviceFamily</key> <array> <string>1</string> <string>2</string> </array>
If you want to limit it to just the iPad for instance, you would only include the 2 value, such as:
<key>UIDeviceFamily</key> <array> <string>2</string> </array>
The UIStatusBarStyle can be set to 3 different values. More details can be found here, but here is a summary of the 3 values.
UIStatusBarStyleDefault – A gray style (the default)
UIStatusBarStyleBlackTranslucent – A transparent black style (specifically, black with an alpha of 0.5)
UIStatusBarStyleBlackOpaque – An opaque black style
Note: The iOS docs mention that on the iPad the UIStatusBarStyleDefault and UIStatusBarStyleBlackTranslucent styles default to the UIStatusBarStyleBlackOpaque appearance.
When the UIRequiresPersistentWiFi flag is set to true, it indicates you need to keep the wifi connection open during the lifetime of your application. If it’s set to NO (or default), it will close the connection after 30 minutes.
The requestedDisplayResolution setting should be set to high such as shown here if you want your application to take advantage of the retina display screen and 960×640 resolution. Otherwise the default is standard and it will not take advantage of the high resolution when running on those devices. If you’re running on a non-retina display screen this setting is ignored.
One excerpt from the Adobe docs that further describes this resolution property says that it: “Specifies whether the application desires to use the standard or high resolution on an iOS device with a high-resolution screen. When set to standard, the default, the screen will appear to the application as a standard-resolution screen. In other words, the fullscreen stage dimensions are 320×480, even on a 640×960 high-resolution screen. When set to high, the application can address each high-resolution pixel. In other words, the fullscreen stage dimensions are 640×960. On devices with standard-resolution screens, the stage dimensions match the screen dimensions no matter which setting is used.”
Therefore, it would seem like a good idea to generally set this value to high, unless your application specifically does not want to take advantage of the higher resolution:
The UIRequiredDeviceCapabilities can be added to indicate that the application can ONLY be installed when the device has certain capabilities. Here’s an example, but for the complete list, see the link I recommend below…
<key>UIRequiredDeviceCapabilities</key> <array> <string>microphone</string> <string>gps</string> <string>camera-flash</string> </array>
I highly recommend perusing this link for more details and information about which key/value pairs can be specified in this section because not all of the iOS settings are directly available and there are a couple others that could be of interest, such as using a custom URI or exiting your application when it’s paused or put in the background.
Flash Builder 4.5.1 Updater (for existing Flash Builder installs)
Apple Developer Program Guide
Adobe Devnet – Guide for Apple App Store Submissions
Antonio Holguin’s iOS Development Process Summary
iPhone Dev’t – Good Practices
iPhone iPad Development Guide
Credits and References:
Apple Developer Program Guide (some screenshots used in order to use generic id’s)