From Birnam Designs Wiki
Basic instructions on how to run an Air application and build an Air installer from command line tools. Also read Adobe's documentation.
This assumes the mxml and xml files are already made, and that amxmlc is already in the path.
Contents |
Build the SWF file
The mxml application first needs to be built out into a flash swf file. Adobe has provided amxmlc for just this. amxmlc is a modified version of mxmlc that automatically uses the parameters needed to build for an Air target (vs. a plain swf).
amxmlc MyAir.mxml
Test the Air app
The swf the previous command created won't run correctly as a normal flash movie, via flashplayer or browser plugin. To test it you can run it with adl. This requires a properly formatted application descriptor xml file.
adl MyAir-app.xml
Create a certificate
For a basic, untrusted, and unverified installer, you can create a self-signed certificate with adt. The type can be either "1024-RSA" or "2048-RSA". You can also add information like org_unit (-ou), org_name (-o), and country (-c), but name (-cn) is the only required option. The last parameter is a password that you will need when compiling the installer, so don't lose/forget it.
adt -certificate -cn SelfSign 1024-RSA cert.pfx p@s$w0rD
This command can take a very long time!
Package the Air app
And the final step, also using adt, is to package it into a .air file that can be installed on a user's computer. It uses the xml descriptor, the swf file you created in step 1, and the certificate file you created previously.
adt -package -storetype pkcs12 -keystore cert.pfx MyAir.air MyAir-app.xml MyAir.swf
This will ask for the password you used when creating the certificate. Additional components, files, directories, etc. can be appended to the end of this command. You can think of that last parameter as an 'input files' parameter, similar to how one might define a list of files to be archived with a tar or zip operation.