Appendix B. Compiling Applications from the Command Line

If you are working solely in Flash Builder or simply prefer to use the command line, you can compile Android and iOS applications directly from the command line.

COMPILING ANDROID APPLICATIONS

To compile .apk files, you use the Adobe Integrated Runtime (AIR) ADT tool from the command line and supply several parameters to it. The ADT (adt.bat on Windows) is located in the bin subdirectory, inside of the AIR SDK folder.

Here's the basic syntax:

adt  -package
     -target apk|apk-debug
     -storetype keyType
     -keystore p12File
     -storepass password
     outputPackage
     appDescriptorXMLFile
     inputPackage

If you plan to use the ADT from command line, you'll want to be sure to add its path as an environment variable. Table B-1 shows the ADT parameters.

Table B.1. ADT Parameters

PARAMETER

DESCRIPTION

-package

Tells ADT that you want to create a package

-target

apk for a final version of your app apk-debug for a debug version to install on your Android device

 

-storetype keyType

Type of key (e.g., pkcs12)

-keystore p12File

Path and filename of your .p12 certificate

-storepass password

Password of your .p12 certificate

"outputPackage"

Filename of your output .apk package

"appDescriptorXMLFile"

Path and filename of your application descriptor XML file

"inputPackage"

Name of your .swf file that will be packaged as a .apk file, along with any other files (such as, icons) that you wish to be added to the package

Here's an example:

adt -package -target apk-debug -storetype pkcs12 -keystore ...

Get Professional Flash® Mobile Development: Creating Android™ and iPhone® Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.