AIR 2.6 iPad example on iOS with FDT4

Last friday I worked on getting an Air 2.6 application running on my iPad. Today I want to share with you how to do this. It’s not hard but you have to go through some steps to accomplish this. Please note that to run your AIR application on your iPad you need to have an Apple Developers license ($99 a year). To build a project on the iPad you have to create a ‘provisioning profile’ and get a ‘.p12′ developers certificate. If you go to the provisioning portal it’s pretty easy to find. There is also a guide written by Adobe. If you have your .p12 and your .mobileprovision file you can continue reading.

Getting the latest FlexSDK and merge it with AIR 2.6

For my test project I have used Flex 4.1.x SDK. You can download this SDK right here. Uncompress the zipfile and put it somewhere safe. Then download the AIR 2.6 SDK from this page. Put this zip file inside the FlexSDK folder you just downloaded and open the terminal and navigate to the SDK folder. Then it’s time to merge the SDK’s you do this with this command:

tar jxvf AdobeAIRSDK.tbz2

Now the SDK is ready for use in FDT, I will guide you through the steps of getting a simple project running on the iPad.

Adding the new SDK files in FDT

In FDT open the settings and navigate to ‘FDT > Installed SDKS’

In this screen click ‘add’ and then click ‘directory’ from the screen that pops up. Choose the folder you have saved the combined SDK in, and click ‘open’. FDT will then start it’s hunt for all the SDK files;

The end result should look very similar to this screenshot: (don’t forget to give it a name so you can find it later)

Downloading my example project

As an example I added my demo project to Github so you can have a quick start. Click here to download this. Then go back to FDT and click File > import. In the import dialog pick ‘existing project into workspace’

Click on ‘browse’ and find my example project you just download from, then click ‘Finish’. Now pick the new FlexSDK which includes AIR 2.6. Right click on the project name and choose ‘Flash project > remove Flash nature’. When the Flash nature is removed, right click and choose ‘Flash project > Add Flash nature’. In this dialog you can pick your new FlexSDK. Click ‘ok’ to add this.

Using the build.xml ANT file

To use the ANT files you first need to edit the ‘FLEX_HOME’ in the ‘local.properties’ file.

Then drag the build.xml from the build folder to the ANT panel.

Then click right on ‘Air Export’ and choose ‘Run as > External tools configurations’ in the JRE tab be sure ‘Run in the same JRE as the workspace is enabled‘. If you enabled this click ‘apply’ and ‘close’.

Then you can run the SWF by double clicking the ‘FDT create SWF debug’ the AIR app should look like this:

Getting it on the iPad

If you want to run it on the iPad replace my example certificates from the folder resources/ios/ with your own files. Also update the password in ‘build.properties‘.

Then it’s time to click the ‘iOS create IPA ad-hoc’ ANT task. The .ipa file is than created and uploaded to your iPad.

End result

So additional references:

Big thanks to blog.derraab.com for the hints on the ANT file.


THE COMMENTS:



  • What derRaab said 1 hour later:

    Always glad to help! :)

  • What Marco Alting said 23 hours later:

    Nice one JK, are you planning on adding info on the descriptor file?

  • What Joshua said 4 days later:

    Thanks for this Yankee’s!

    Komt goed van pas.

  • What Niels said 7 days later:

    Looks like the new Flex SDK (flex_sdk_4.5.0.20967) has the AIR stuff all ready included …

  • What Niels said 8 days later:

    off course ;-( any ideas ??

    BUILD FAILED
    /Users/nyls/projects/Air/base42-AIR-2.6-iOS-example-for-FDT-a0629ba/build/build.xml:65: Execute failed: java.io.IOException: Cannot run program “/Users/nyls/Documents/projects/sdk/flex_sdk_4.5.0.20967/bin/adt” (in directory “/Users/nyls/projects/Air/base42-AIR-2.6-iOS-example-for-FDT-a0629ba/build”): error=2, No such file or directory

  • What Meinaart said 10 days later:

    Thanks a lot, works great! :)

  • What Mike said 41 days later:

    Thanks, this worked for me!

  • What gabriele said 141 days later:

    great tips! thank you

  • What gabriele said 158 days later:

    hey ciao,
    I did all the passages but I got this error :
    iOS create IPA ad-hoc:

    Open in Itunes:
    [exec] The file /Users/gabrielepalumbo/Documents/workspace/AIR 2.6 IOS Example/bin/kweenie-app.ipa does not exist.
    [exec] Result: 1

    could you please help me to find out the problem?

    Thank you very much

    gabriele

  • What Jankees said 158 days later:

    Hi Gabriele,

    Can you send me a zip with your project so i can verify what you have done?

    Thanks!

  • What gabriele said 158 days later:

    sure but I will remove info about apple license etc…
    apart from that I don’t think there is anything different from your code ;-)

    which email I can send to?

    thank you

  • What Magnus said 228 days later:

    Your example works fine for me. Thanks!
    Is it possible to turn it into an iPhone App somehow? Where/how did you set the iPad as target?

    Best

    • What jankees said 228 days later:

      You can create an .ipa which you can drag to iTunes… That should do it.

    • What Magnus said 228 days later:

      Yes, I see the App in iTunes, but it’s filed under “iPad Apps”, not in “Apps for iPhone, iPod Touch” and I can’t drag it into an other section.

    • What jankees said 228 days later:

      What derRaab says should fix it :)

  • What derRaab said 228 days later:

    Check your application descriptor XML file. Within the part you need to define your “UIDeviceFamily” …

    • What jankees said 228 days later:

      Thanks for helping!

    • What Magnus said 228 days later:

      Perfect, thank you both!

      UIDeviceFamily
      1 = (Default) The application runs on iPhone and iPod touch devices.
      2 = The application runs on iPad devices.

Leave a Reply


− 1 = six