Previous Page Next Page

2.5. Setting Up the Adobe AIR SDK and Command-Line Tools

The Adobe AIR SDK beta contains tools, samples, and code that make it easier to develop, test, and deploy applications. In particular, it contains two command-line tools that we will use:


ADL

You use this tool to launch and test an Adobe AIR application without having to install it first.


ADT

You use this tool to package and sign an AIR application for distribution.

2.5.1. Installing the Adobe AIR SDK

To ease development, you should place the path to these files within your system's path. This will allow you to execute the tools from anywhere on your system.

The command-line tools are located in the bin directory within the SDK.

  1. Download the Adobe AIR SDK from http://www.adobe.com/go/getairsdk.

  2. Open the SDK:

    a) On Windows, uncompress the ZIP archive.

    b) On Mac, mount the .dmg file.

  3. Copy the contents of the SDK to your system (we will refer to this location as <SDK_Path>).

    NOTE

    To run the command-line tools, you need to copy only the bin, lib, and runtime directories from the SDK.

    It's important that the bin, lib, and runtime directories within the SDK maintain their relative paths to each other.

  4. At this point, you should have at least the following three directories: <SDK_Path>/bin, <SDK_Path>/lib, and <SDK_Path>/runtime. The ADL and ADT command-line tools are located in the bin directory.

2.5.2. Placing the Command-Line Tools Within the System Path

All that is left to do is to place the <SDK_Path>/bin directory into your system path so that you can execute the command-line applications from anywhere on your system.

The instructions for this are different depending on whether you are on a Mac or Windows-based system.

2.5.3. Windows

If you are on a Windows system, follow these steps:

  1. Open the System Properties dialog box and click the Advanced tab. You can find this in the System settings in the Control Panel.

  2. Click the Environment Variables button.

  3. Select the PATH entry and then click the Edit button. Add the path to the bin directory to the end of the current variable value, separating it from previous values with a semicolon:

    ; <SDK_Path>/bin
    

    Figure 2-1 Editing PATH variables in Windows.

    Figure 2-1. Placing command-line tools in the system path on Windows

  4. Click OK to close the panels.

To test the installation, open a new Windows Console (Startrightwards double arrowRunrightwards double arrowConsole), and type adt.

NOTE

Make sure you open a new Console window in order to ensure the new PATH settings take affect.

You should see output similar to this:

usage:
  adt -package SIGNING_OPTIONS <air-file> <app-desc> FILE_ARGS
  adt -prepare <airi-file> <app-desc> FILE_ARGS
  adt -sign SIGNING_OPTIONS <airi-file> <air-file>
  adt -checkstore SIGNING_OPTIONS
  adt -certificate -cn <name> ( -ou <org-unit> )? 
( -o <org-name> )? ( -c <country> )?
 <key-type> <pfx-file> <password>
  adt -help

SIGNING_OPTIONS: -storetype <type> ( -keystore <store> )? 
( -storepass <pass> )? ( -keypass <pass> )? ( -providerName
 <name> )? ( -tsa <url> )?
FILE_ARGS: <fileOrDir>* (( -C <dir> <fileOrDir>+ ) | 
( -e <file> <path> ))* -C dir

This means the tools are configured correctly.

If you get an error stating that the file cannot be found, do the following:

2.5.4. Mac

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 following instructions explain how to modify your PATH environment variable if you are using the bash shell:

  1. Open the Terminal program (/Applications/Utilities/Terminal). Make sure you're in your home directory by typing cd and pressing Enter.

  2. Check to see whether one of two files is present. Enter the command ls -la.

  3. Look for a file named either .profile or .bashrc.

  4. If you have neither file, create the .profile file with the command touch .profile.

  5. Open the .profile or .bashrc file with a text editor.

  6. Look for a line that looks similar to this:

    export PATH=$PATH:/usr/local/bin
    

  7. Add the path to the <SDK_Path>/bin directory to the end of this line. For example, if <SDK_Path>/bin is at /airsdk/bin, the export path should look something like this:

    export PATH=$PATH:/usr/local/bin;/airsdk/bin
    

    Make sure you separate the entries with a colon.

  8. If the file is empty, add the following line:

    export PATH=$PATH:/airsdk/bin
    

  9. Save and close the file.

  10. Run the command source .profile to load the new settings (or .bashrc, if that is the file you edited).

  11. Confirm that the new settings have taken effect by typing echo $PATH and pressing Enter. Make sure the <SDK_Path>/bin path is included in the output.

  12. To test the installation, open a Terminal window and type adt.

    You should see output similar to this:

    usage:
      adt -package SIGNING_OPTIONS <air-file> <app-desc> 
      FILE_ARGS
      adt -prepare <airi-file> <app-desc> FILE_ARGS
      adt -sign SIGNING_OPTIONS <airi-file> <air-file>
      adt -checkstore SIGNING_OPTIONS
      adt -certificate -cn <name> ( -ou <org-unit> )? 
      ( -o <org-name> )? ( -c <country> )?
      <key-type> <pfx-file> <password>
      adt -help
    
    SIGNING_OPTIONS: -storetype <type> ( -keystore 
    <store> )? ( -storepass <pass> )? ( -keypass <pass> )? 
    ( -providerName <name> )? ( -tsa <url> )? FILE_ARGS: 
    <fileOrDir>* (( -C <dir> <fileOrDir>+ ) | ( -e <file>
    <path> ))* -C
    

    This means the tools are configured correctly.

If you get an error stating that the file cannot be found, do the following:

Previous Page Next Page