ADT package commandThe -package command should be run from the main application directory. The command uses the following syntaxes: Create a package from the component application files: adt -package AIR_SIGNING_OPTIONS -target packageType NATIVE_SIGNING_OPTIONS output app_descriptor FILE_OPTIONS Create a native package from an AIRI file: adt -package AIR_SIGNING_OPTIONS -target packageType NATIVE_SIGNING_OPTIONS output input_airi Create a native package from an AIR file: adt -package -target packageType NATIVE_SIGNING_OPTIONS output input_air Create an AIR Native Extension package from the component extension files: adt -package AIR_SIGNING_OPTIONS -target ane output ext_descriptor ANE_OPTIONS AIR_SIGNING_OPTIONS The AIR signing options identify the certificate used to sign an AIR installation file. The signing options are fully described in ADT code signing options. -target The type of package to create. The supported package
types are:
NATIVE_SIGNING_OPTIONS The native signing options identify the certificate used to sign a native package file. These signing options are used to apply a signature used by the native operating system, not the AIR runtime. The options are otherwise identical to the AIR_SIGNING_OPTIONS and are fully described in ADT code signing options. Native signatures are supported on Windows and Android. On Windows, both an AIR signing options and the native signing options should be specified. On Android, only the native signing options can be specified. In many cases, you can use the same code signing certificate to apply both an AIR and a native signature. However, this is not true in all cases. For example, Google’s policy for apps submitted to the Android Market dictates that all apps must be signed with a certificate valid for at least 25 years. This means that a certificate issued by a well known certificate authority, which are recommended when applying an AIR signature, should not be used to sign an Android app. (No certificate authorities issue a code signing certificate with that long a validity period.) output The name of the package file to create. Specifying the file extension is optional. If not specified, an extension appropriate to the -target value and current operating system is added. app_descriptor The path to the application descriptor file. The path can be specified relative to the current directory or as an absolute path. (The application descriptor file is renamed as application.xml in the AIR file.) ext_descriptor The path to the extension descriptor file (used when packaging a AIR native extension). The path can be specified relative to the current directory or as an absolute path. FILE_OPTIONS Identifies the application files to include in the package. The file options are fully described in File and path options. Do not specify file options when creating a native package from an AIR or AIRI file. input_airi Specify when creating a native package from an AIRI file. The AIR_SIGNING_OPTIONS are required if the target is air (or no target is specified). input_air Specify when creating a native package from an AIR file. Do not specify AIR_SIGNING_OPTIONS. ANE_OPTIONS Identifies the options and files for creating an AIR Native Extension package The extension package options are fully described in AIR native extension options. ADT -package command examplesPackage specific application files in the current directory for a SWF-based AIR application: adt –package -storetype pkcs12 -keystore cert.p12 myApp.air myApp.xml myApp.swf components.swc Package specific application files in the current directory for an HTML-based AIR application: adt –package -storetype pkcs12 -keystore cert.p12 myApp.air myApp.xml myApp.html AIRAliases.js image.gif Package all files and subdirectories in the current working directory: adt –package -storetype pkcs12 -keystore ../cert.p12 myApp.air myApp.xml . Note: The keystore file contains the private key used
to sign your application. Never include the signing certificate
inside the AIR package! If you use wildcards in the ADT command,
place the keystore file in a different location so that it is not
included in the package. In this example the keystore file, cert.p12,
resides in the parent directory.
Package only the main files and an images subdirectory: adt –package -storetype pkcs12 -keystore cert.p12 myApp.air myApp.xml myApp.swf images Package an HTML-based application and all files in the HTML, scripts, and images subdirectories: adt –package -storetype pkcs12 -keystore cert.p12 myApp.air myApp.xml index.html AIRALiases.js html scripts images Package the application.xml file and main SWF located in a working directory (release/bin): adt –package -storetype pkcs12 -keystore cert.p12 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 before packaging: /devRoot
/myApp
/release
/bin
myApp-app.xml
myApp.swf or myApp.html
/artwork
/myApp
/images
image-1.png
...
image-n.png
/libraries
/release
/libs
lib-1.swf
lib-2.swf
lib-a.js
AIRAliases.js
Running the following ADT command from the /devRoot/myApp directory: adt –package -storetype pkcs12 -keystore cert.p12 myApp.air release/bin/myApp-app.xml
–C release/bin myApp.swf (or myApp.html)
–C ../artwork/myApp images
–C ../libraries/release libs
Results in the following package structure: /myAppRoot
/META-INF
/AIR
application.xml
hash
myApp.swf or myApp.html
mimetype
/images
image-1.png
...
image-n.png
/libs
lib-1.swf
lib-2.swf
lib-a.js
AIRAliases.js
Run ADT as a Java program for a simple SWF-based application (without setting the classpath): java –jar {AIRSDK}/lib/ADT.jar –package -storetype pkcs12 -keystore cert.p12 myApp.air myApp.xml myApp.swf
Run ADT as a Java program for a simple HTML-based application (without setting the classpath): java –jar {AIRSDK}/lib/ADT.jar –package -storetype pkcs12 -keystore cert.p12 myApp.air myApp.xml myApp.html AIRAliases.js
Run ADT as a Java program (with the Java classpath set to include the ADT.jar package): java -com.adobe.air.ADT –package -storetype pkcs12 -keystore cert.p12 myApp.air myApp.xml myApp.swf Run ADT as a Java task in Apache Ant (the paths shown in the example are for Windows): <property name="SDK_HOME" value="C:/AIRSDK"/>
<property name="ADT.JAR" value="${SDK_HOME}/lib/adt.jar"/>
target name="package">
<java jar="${ADT.JAR}" fork="true" failonerror="true">
<arg value="-package"/>
<arg value="-storetype"/>
<arg value="pkcs12"/>
<arg value="-keystore"/>
<arg value="../../ExampleCert.p12"/>
<arg value="myApp.air"/>
<arg value="myApp-app.xml"/>
<arg value="myApp.swf"/>
<arg value="icons/*.png"/>
</java>
</target>
Note: On some computer systems, double-byte characters in the file
system paths can be misinterpreted. If this occurs, try setting
the JRE used to run ADT to use the UTF-8 character set. This is
done by default in the script used to launch ADT on Mac and Linux.
In the Windows adt.bat file, or when you run ADT directly from Java,
specify the -Dfile.encoding=UTF-8 option on the
Java command line.
|
|