Installing the Adobe AIR SDK on a Mac

I recently attempted to install the Adobe AIR SDK on my MacBook Pro so that I could compile AIR applications. While Adobe’s done some great work at developing and exposing their tools early to the public, I could not find a set of instructions that resulted in a working installation.

Luckily, Yahoo! Developer Network co-worker JR Conlin stepped up and helped me fill in a couple blanks. As such, I present my revision to the O’Reilly Adobe Integrated Runtime (AIR) for JavaScript Developers Pocket Guide (by Mike Chambers, Daniel Dura, & Kevin Hoyt)… particularly pages 27 and 28, Setting Up the AIR SDK and Command-LineTools:

There are a number of ways to add the path to the AIR SDK to your system path, depending on which shell you are using, and how you specify user environment variables.

The instructions below show how to modify your path environment variable if you are using the bash shell.

  1. Open the Terminal program (/Applications/Utilities/Terminal)
  2. Make sure you’re in your home directory by typing
    cd

    and pressing enter.

  3. We need to check to see if one of two files are present. Run the following command
    ls -la
  4. Look for a file named either.profile or.bashrc.
  5. If you have neither the .profile or .bashrc file, then create the .profile file with the following command:
    touch .profile
  6. Open the .profile or .bashrc file with a text editor.
  7. Look for a line that looks similar to this:
    export PATH=$PATH:/usr/local/bin
  8. Add the path to the /bindirectory to the end of this line. For example, if /bin is at /airsdk/bin, the export path should look something like this:
    export PATH=$PATH:/usr/local/bin;/airsdk/bin

    making sure to separate the entries with a colon.

  9. If the file is empty, add the following line:
    export PATH=$PATH:/airsdk/bin
  10. Save and close the file.

Insert: Quit Terminal (and other applications), and restart your Mac. (If you don’t restart your Mac, your Terminal application won’t recognize the changes.)

  1. Run the following command to load the new settings source,
    .profile

    (or

    .bashrc

    , if that is the file you edited).

Revise item #11: Run the following command to load the new settings source,

. .profile

(or

. .bashrc

, if that is the file you edited).

  1. You can confirm that the new settings have taken effect by typing
    echo $PATH

    and pressing Enter. Make sure that the

    /bin

    path is included in the output.

  2. In order to test the installation, open a Terminal window and type
    adt

    .

    You should see output similar this:

    Too few arguments.
    Usage: adt -package air_file app_xml [ file_or_dir | -C dir file_or_dir ... ] ...

    meaning that the tools are configured correctly.

If you get an error that the file cannot be found, then check the following things:

  • Make sure the bin and runtime directories are included in the

    directory.

  • Make sure you included the path to
    /bin

    correctly in the PATH environment variable.

  • Make sure you either opened a new Terminal window, or ran source on your configuration file.

If this works for you, too (or, if it does not), drop me a line in the Comments section. I will try to keep this updated as I hear from folks. Having recently spoke at the Atlanta stop of the OnAir tour, I can attest that developers are building exciting things with AIR… hopefully this will help a few others join those legions.



·