How to build a Flex Mobile App with Maven
Building applications that run on mobile is today’s trend. Everybody is thinking mobile and social and cloud.
To build a Flex application for Mobile is very easy, provided you use Flash Builder. When it comes to automating that build, things are not as easy. Because recently I’ve managed to overcome the obstacles that were preventing me to build a running Flex 4.5 app for mobile, I want to share the build.
I’ve taken the initial build from this thread. Marvin Froeder ( a.k.a VELO ) has been doing some hard work recently, creating the Enterprise version of Flex Mojos. This version seems pretty promising. I’m looking forward for its release. When you’re testing the build, make sure you register during the build, following the instructions. The process is fairly easy, but … rewarding. The maven build creates the final apk/air/exe/dmg…, which you can use to install the app on your device. It’s worth trying it.
To build the app, you need to execute
mvn3 clean install package
Prior to the build, you need to make sure you have Maven 3 installed, with the following environment variable:
MAVEN_OPTS="-Xmx1024m -Xms128m -XX:+DisableAttachMechanism"
Also, you need to have the mobile theme installed in a repository. As of today, the flex mojos repository doesn’t contain this theme, so you need to install it manually.
When the build ends, connect your device to the computer and execute:
adb install -r ./target/mobile-1.0-SNAPSHOT.apk
Then, go to your device and open “main” application.
If you see the following screen, it means that the application got compiled successfully.

Hi nice article.
I followed the steps but i’m running into a problem.
Maven is not able to download: aot-2.6.zip.
https://s3.amazonaws.com/flexmojos-extras/snapshot/com/adobe/adl/aot/2.6/aot-2.6.zip
When i navigate to the url in the browser see a Access Denied error.
I hope you can help me out or provide me the aot-2.6.zip.
July 21st, 2011 at 4:59 pmCheers,
Tim
That repo is working now. I’ve tested it. I guess sometimes is down.
July 21st, 2011 at 6:09 pmMartin??? Marvin
September 16th, 2011 at 3:37 pmThanks for the catch MarVin
.I’ll correct it now. Sorry
September 18th, 2011 at 8:59 pmIf your running on mac 10.6.8 with sdk 4.5.0.20967 you will need to add -d32 to MAVEN_OPTS to force 32bit JVM.
Calling two build phases that include package crashed the JVM on the second run. Just call mvn clean install or mvn clean package worked better for me.
September 19th, 2011 at 7:07 pm