Skip navigation

While I was developing on an application for mobile using Adobe AIR and Adobe Flex SDK, I run into a routine for packaging my application as a native installer for a specific device such as iOS and Android.

Using AIR Development Tool (ADT) -package command to we can create the application package. The -target parameter specifies which mobile platform the package is created.

ADT Package Command Syntax

$ adt -package
AIR_SIGNING_OPTIONS
-target packageType
NATIVE_SIGNING_OPTIONS
output
app_descriptor
FILE_OPTIONS

-package
Packages an AIR application or AIR Native Extension (ANE)

AIR_SIGNING_OPTIONS
-target     The type of package to create.
Package Type for Mobile

Andriod targets:
apk A package produced with this target can only be installed on an Android device, not an emulator.
apk-debug An Android package with extra debugging information. (The SWF files in the application must also be compiled with debugging support.)
apk-emulator An Android package for use on an emulator without debugging support. (Use the apk-debug target to permit debugging on both emulators and devices.)
apk-profile An Android package that supports application performance and memory profiling.
iOS targets:
ipa-ad-hoc An iOS package for ad hoc distribution.
ipa-app-store An iOS package for Apple App store distribution.
ipa-debug An iOS package with extra debugging information. (The SWF files in the application must also be compiled with debugging support.)
ipa-test An iOS package compiled without optimization or debugging information.
ipa-debug-interpreter Functionally equivalent to a debug package, but compiles more quickly. However, the ActionScript bytecode is interpreted and not translated to machine code. As a result, code execution is slower in an interpreter package.
ipa-test-interpreter Functionally equivalent to a test package, but compiles more quickly. However, the ActionScript bytecode is interpreted and not translated to machine code. As a result, code execution is slower in an interpreter package.

NATIVE_SIGNING_OPTIONS
These signing options are used to apply a signature used by the native operating system, not the AIR runtime.

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.)

FILE_OPTIONS
Identifies the application files to include in the package.

For more information about ADT package command click through the link.

Here is a simple example of bash script.

#!/bin/sh
# echo, outputs the arguements string
echo 'TARGET OPTIONS ( ipa-test | ipa-debug | ipa-app-store | ipa-ad-hoc)'
# -n, suppressed the trailing newline
echo -n 'Compile for what target?'
# user input value for $target
read target

# use double-quote to concatenate $target
package_target=”-package -target $target”
storetype=’-storetype pkcs12′
keystore=’-keystore greatxam_apple_cert.p12′

output_package=’HobbiesAndVices.ipa’
desc=’HobbiesAndVices-app.xml’
swf=’HobbiesAndVices.swf’
others=’assets Default.png’

adt $package_target $profile $storetype $keystore $output_package $desc $swf $others

For more information about bash, go to the Bash Reference Manual

Advertisements