On AIR in ten minutes (aka quickstart for Adobe AIR)

A very quick quickstart for getting your Adobe AIR or Flex SDK installed, and start coding right away.

Tools needed :

AdobeAIRInstaller.exe from http://www.adobe.com/products/air/tools/
Adobe AIR SDK from http://www.adobe.com/products/air/tools/.
A text editor.

DISCLAIMER: the following steps involve modifying potentially dangerous settings. Other apps could stop working. You are warned. Follow the steps outlined only if you feel confident.

Install AdobeAIRInstaller.exe.

Unpack the SDK in a X:\<whatever>\AIRSDK where <whatever> is the path you like and X is the drive letter you prefer.Navigate to X:\<whatever>\AIRSDK. You should see some directories like:

bin frameworks
lib runtime samples
src templates

Note especially the bin/.

Now, write down, or cut&paste somewhere the path of the bin/. You should have something like:

C:\Mydirectory\AIRSDK\bin

Now add this path to the PATH variable in your system (see http://support.microsoft.com/kb/310519 ), choose path from the System variables and the modify. Don’t touch the paths already in there, but add a “;” at the end of the string and add “C:\Mydirectory\AIRSDK\bin” to the end. The final result should be something like:

(I know, it’s Italian, and it shows flex_sdk_3\bin instead of AIRSDK\bin, but you got the idea)

In case you touch the paths already there, press cancel, and DON’T save. Other apps could stop working properly if you modify the paths in the wrong way.

Now your AIR binary files should be in path, and this means that if you open a NEW command prompt session (Run->cmd, you should be able to launch adt and the other tools from any path.
If you wish you can check. Open a command prompt, and your initial path should be your home directory (for example, C:\Documents and Settings\kent, where kent is the name of your user). Now issue adt –help from there. If the path is set correctly, that’s what you should expect.

C:\Documents and Settings\kent>adt -help
usage:
adt -package SIGNING_OPTIONS FILE_ARGS
adt -prepare FILE_ARGS
adt -sign SIGNING_OPTIONS
adt -checkstore SIGNING_OPTIONS
adt -certificate -cn ( -ou )? ( -o )? ( -c
ry> )?
[...]

If it complains about the unknown file or whatever, recheck the path you issue, or close this command prompt and open a new one. If it complains, re-check.
Now you are ready. Create a directory somhere (let’s say C:\Documents and Settings\kent\Documenti\HelloWorld.
Open up a Command prompt and navigate to it.

C:\Documents and Settings\kent>cd C:\Documents and Settings\kent\Documenti\HelloWorld
C:\Documents and Settings\kent\Documenti\HelloWorld>

From now on, follow the steps outlined here:
http://livedocs.adobe.com/air/1/devappshtml/help.html?content=HTMLHelloWorld_1.html
Remeber to copy AIRAliases.js from C:\Mydirectory\AIRSDK\frameworks to C:\Documents and Settings\kent\Documenti\HelloWorld.
It should work.

Advice: there are a lot of tutorials with examples related to the old AIR version (codename Apollo) or beta relases.
If you use them, your mileage may vary. Anyway the AIR ones are still usable, taking care of choosing the right Application Descriptor, or you will get an invalid application descriptor error. The Application descriptor lies here HelloWorld-app.xml, and in some examples still relies on older versions. You will the get an error similar to “invalid application descriptor: descriptor version does not match runtime version”. This is bad. The correct application descriptor for your AIR version should be in C:\Programmi\Adobe\AIRSDK\templates\descriptor-template.xml.
For AIR1.0 we have:

<application xmlns=”http://ns.adobe.com/air/application/1.0″>

and not:

<application xmlns=”http://ns.adobe.com/air/application/1.0.M6″> or whatever.
Have Fun, and remember, the docs in http://livedocs.adobe.com/air/1/devappshtml/ should be up-to-date and your best bet at the beginning.