Building Flex mobile applications from the Command Line

Posted on November 5, 2010 | Comments Off

Inside the new Flex Hero SDK there is a new airmobile-config.xml file that is used when compiling Flex mobile applications. This file does a couple of things differently. Since Flex mobile applications are only supported on standalone applications right now it uses the AIR libraries. It adds a library path to libs/mobile. It setups up the default preloader as the spark.preloaders.SplashScreen. Lastly it sets the default them to:

<!-- List of CSS or SWC files to apply as a theme. -->
<theme>
    <!-- default theme is mobile overlayed on top of spark -->
    <filename>themes/Mobile/spark.css</filename>
    <filename>themes/Mobile/mobile.swc</filename>
</theme>

It is worth pointing one method of compiling the SWF on the command line, see below:

>mxmlc +configname=airmobile FlexMobileTest.mxml -o FlexMobileTest.swf

Then to test you would run it with adl (since its an SWF with AIR apis) and use adt to package it up.