Installing the Adobe AIR 2 Beta SDK on OS X

I’m sure I’m not the only one who was super stoked when Adobe released the beta of AIR 2.0. For those not familiar,  Adobe added a laundry list of new toys, like support for mass storage devices, UDP sockets, and my personal favorite native code integration. You can check out the full list at Adobe Labs.

Of course, as these things always seem to go with beta stuff it wasn’t completely trivial to get things up and a running so I decided to write this post up. Note these instructions assume you’re using Flex 3 and Flex Builder 3, but there’s no reason this shouldn’t work with Flex 4 and Flash Builder 4. I haven’t tried this yet because I haven’t made the jump myself, but would love to hear from anyone who can verify this. Without further ado…

1. Download and run the AIR 2.0 runtime and SDK

2. Make a copy of your Flex SDK – On OS X this should located in ~/Applications/Adobe\ Flex\ Builder\ 3/sdks. I called mine “3.4andAir2″. Alternatively if you haven’t updated your flex SDK in a while you can get the latest version of Flex 3 from here.

3. Overlay the AIR 2 SDK over the copied SDK – Since the AIR SDK is interwoven with  the Flex SDK this is actually a bit tricky. I first tried to do it manually by copying over each relevant file and folder. I’m not sure if I was careless, but flex builder didn’t recognize any of the AIR 2.0 API calls. Luckily, I did a bit of search and found the “ditto” command, which will do exactly what we need.  Once you’ve mounted the AIR 2 dmg, open up your terminal and you can use ditto as follows to overlay AIR 2.0:

ditto -V /Volumes/AIR\ SDK/ /Applications/Adobe\ Flex\ Builder\ 3/sdks/3.4andAir2/

This should ovewrite the AIR 1.5 SDK with AIR 2.0 SDK.

4. Add the new SDK to Flex Builder – Go to Flex Builder > Preferences > Installed Flex SDKs > Add… Point it to your 3.4andAir2 sdk folder you made.

5. Start a new project

6. Change compiler settings to point to the new SDK – Project > Properties > Flex Compiler > Use a Specific SDK

7. Change the application descriptior file - Change the line 2 to: <application xmlns=””>

8. Verify – Add the following line of code and make sure you don’t get any build errors:

private var process:NativeProcess

That’s it! Stay tuned for my next post where I’ll dig into the NativeProcess API!

Update: In response to my blog post Christian Cantrell, AIR product manger, pointed out the key to getting the overlaying to work is not using the finder. Other methods besides ditto also work like cp -r and tar -xfj

  • Share/Bookmark
  • Bhavin

    superb man

    this MAC has ruined my mind...
    how to run adt on MAC now ?

  • claire

    As far as I can tell I overlayed the files correctly.
    I have Flex and Air2Beta2

    My app builds but when I try to launch it in the IDE I get this:

    [SWF] myapp.swf - 5,842,270 bytes after decompression
    myapp v 0.1
    NativeProcess supported.
    ERROR: Unable to startup application
    [Unload SWF] myapp.swf

    Any ideas? Are my SDK files not right or could it be something else?


  • thetaytay

    Thanks! This was a big help. I have been looking for the ditto command for a long time, but didn't know what I was looking for! Thanks!

  • yelloCub

    Is this possible to do with Eclipse using Flex Plugin? I tried to follow the steps on the adobe site and also tried to manually copy the files from 'air2_b2_sdk_mac_020210' to my sdk copy (no luck). I keep getting a message when I tell eclipse to use the SDK that it's not a Flex SDK. Anyone else? Maybe you just have to use Flex/Flash Builder standalone?

  • yelloCub

    Looks like I was able to use ditto in the terminal (as you describe above) to get eclipse to at least agree that my new sdk folder a flex sdk. ActionScript projects, unlike Flex Projects in eclipse don't have an Application.xml descriptor file. I am assuming I need to do something similar here since I still cannot import the new AIR2 classes. If someone else has any ideas, pass them along. Still pluggin away here.

blog comments powered by Disqus