Packaging an Apollo application using the Apollo Developer Tool
Back to: Apollo Documentation home page
Package your application as an AIR file for distribution with the Apollo Developer Tool (ADT). ADT creates installation packages for both HTML-based and SWF-based Apollo applications. (If you are using Flex Builder to create your application, you can use the Flex Builder Export wizard to build the AIR file package.)
ADT is a Java program that you can run from the command line or a build tool such as Ant. The SDK includes command-line scripts that execute the Java program for you. See Set up instructions for Flex SDK users for information on configuring your system to run the ADT tool.
Every Apollo application must, at a minimum, have an application descriptor file and a main SWF or HTML file. Any other application assets to be installed with the application must be packaged in the AIR file as well.
Note: The settings in the application descriptor file determine the identity of an Apollo application and its default installation path. See The application descriptor file schema for more information.
ADT usage:
adt -package air_file app_xml [ file_or_dir | -C dir file_or_dir ... ] ...
| Parameter | Description |
|---|---|
| air_file | The name of the AIR file to be created. |
| app_xml | The path to the application descriptor file. No matter what name is assigned to the application descriptor file, it will be renamed to “application.xml? in the package. The path can be specified relative to the current directory or as an absolute path. |
| file_or_dir | The files and directories to package in the AIR file. Any number of files and directories can be specified, delimited by whitespace. If you list a directory, all files and subdirectories within, except hidden files, are added to the package. (In addition, if the application descriptor file is specified, either directly, or through wildcard or directory expansion, it is ignored and not added to the package a second time.) The files and directories specified must be in the current directory or one of its subdirectories. Use the “-C? option to change the current directory.
Important: wildcards cannot be used in the file_or_dir arguments following the –C option. (The command shell expands wildcards before passing the arguments to ADT, which results in ADT looking for files in the original working directory instead of the directory specified by the –C option.) |
| -C dir | Changes the working directory to dir before processing subsequent files and directories added to the application package. The files or directories are added to the root of the application package. The –C option can be used any number of times to include files from multiple points in the file system. If a relative path is specified for dir, the path is always resolved from the original working directory. As ADT process the files and directories to be included in the package, the relative paths between the current directory and the target files are stored. These paths are expanded into the application directory structure when the package is installed. Thus specifying "-C release/bin lib/feature.swf" would place the file "release/bin/lib/feature.swf" in the "lib" subdirectory of the root application folder. |
Note: If you add Xerces.jar to your class path, the ADT application can fully validate the schema of an application descriptor (application.xml) file that you are including in an AIR file. Xerces is included with JDK version 1.5 or later. Xerces is available at http://xerces.apache.org/xerces-j/.
Examples:
Package specific application files in the current directory
adt –package myApp.air myApp.xml myApp.swf components.swc
Package all files and subdirectories in the current working directory
adt –package myApp.air myApp.xml .
Package only the main files and an images subdirectory
adt –package myApp.air myApp.xml myApp.swf images
Package an HTML-based application and all files in the html, scripts, and images subdirectories
adt –package myApp.air myApp.xml index.html html scripts images
Package the application.xml file and main SWF located in a working directory (release\bin):
adt –package myApp.air release\bin\myApp.xml –C release\bin myApp.swf
Package assets from more than one place in your build file system:
- In this example, the application assets are located in the following folders prior to packaging:
/devRoot
/myApp
/release
/bin
myApp.xml
myApp.swf
/artwork
/myApp
/images
image-1.png
...
image-n.png
/libraries
/release
/libs
lib-1.swf
...
lib-n.swf
- When the following ADT command is run from the /devRoot/myApp directory:
adt –package myApp.air release/bin/myApp.xml –C release/bin myApp.swf
–C ../artwork/myApp images –C ../libraries/release libs
Then the resulting package structure will be:
/myAppRoot
/META-INF
/AIR
application.xml
hash
myApp.swf
mimetype
/images
image-1.png
...
image-n.png
/libs
lib-1.swf
...
lib-n.swf
Run ADT as a Java program (without setting the classpath):
java –jar {ApolloSDK}\lib\ADT.jar –package myApp.air myApp.xml myApp.swf
Run ADT as a Java program (with the Java classpath set to include the ADT.jar package):
java com.adobe.apollo.ADT –package –package myApp.air myApp.xml myApp.swf
Note: You must make sure that the root-content element of the application descriptor file specifies the final path to the main application file relative to the root application directory. This may be an issue if the main application file is not located in the current directory when you run ADT.
Back to: Apollo Documentation home page