If you have done any work with Flash, AIR and compiling for iOS devices (iPhone, iPad, etc) then you know that due to the AOT (Ahead Of Time) compilation, it can take a minute or more just to compile your application to an .ipa file. This can take up a lot of time during development. Adobe has been working on improving the workflow for mobile and with the introduction of AIR 2.7, they added a new -target option for ADT via the command line called “ipa-test-interpreter” mode. This produces a special .ipa file that instead of leveraging LLVM to do the AOT compilation, it simply packages up your .SWF as is, and the .ipa includes a runtime interpreter instead. This is much more like the way the AIR works on Android or on the desktop. In this case, its designed to reduce compilation time for development and testing only, its not for producing ad-hoc builds you would want to distribute to others, or your final deployment build. It is a bit slower in performance, but for testing and development, the time saved in compiling is totally worth it. It drops the compilation time down to almost zero, as it is compiling your .SWF as normal, and then marrying it up into a templated .IPA with the interpreter, as opposed to all the overhead of the normal AOT process. From the AIR documentation on this feature:

“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.”

Now you may be thinking great that is awesome, I’m going to start using it, where is it. Well the rub is that currently, it can only be used when invoking adt.jar from the command line to compile your .SWF file to an AIR based .ipa. There is no GUI option for it in Flash CS 5.5 yet. This is not a problem for a lot of folks using ANT, or Flash Builder, or those comfortable with the command line. However, if you are using Flash Professional CS 5.5, then given the lack of any GUI based control over this, you would have to publish your .swf file, switch to a terminal prompt or run some other script in order to invoke adt.jar with the proper -target option. If you’ve ever done development for iOS and know how many clicks are already involved in getting a new .ipa onto a device even when using Xcode or the iPhone Configuration Utility instead of iTunes to take some shortcuts, its still a lot of manual operations, add in switching out of Flash and invoking adt.jar manually, and it is way too much repetitive, annoying operations. A lazy developer is the best developer – be a lazy developer and make a tool to help you be even lazier.

I hate all that extra clicking around as much as the next guy, being a lazy developer, I decided there has to be a way to make this easier. Surely at some point Adobe will enhance Flash CS 5.5 to leverage this new feature directly in the IDE, but I wanted it now. So last night I put together a custom solution that replaces the AIR adt.jar with a shim adt.jar based on a teeny-tiny java class I hacked together, that accepts the arguments from Flash CS 5.5, adjusts the -target option to ipa-test-interpreter, and along with a custom Automator Workflow (containing some shell script, and Applescript) – decouples the process and allows you to publish your .ipa with this new fast interpreted mode. It even includes some nice Growl based notifications, opens the folder where the .ipa is compiled and opens the iPhone Configuration Utility for you automatically so you can just drag and drop your .ipa and get on with testing. Not only solved the problem, but added some bonus functionality. Sweet huh?

A nice side effect is that you can easily retain the log of your adt.jar compilation arguments to use them to create template scripts of common adt.jar scripts you might re-use later. Granted this is a hack, albeit a nice one, but it does have a dependency on Apples Automator, so its currently Mac OS X only. For you Windows folks, you might look into possibly using a classloader to invoke the real adt.jar Main Class entry directly from mine to allow it to work on Windows (that a whole other can of worms) and avoid the dependency on Automator. This wouldn’t allow the other bells and whistles, but it might be workable.

You can see a video of the workflow in action here where I am publishing an app I am working on with this method/code.

Download the source code and binaries for everything (at your own peril, it is provided “as-is”), along with detailed instructions and notes here:

If anyone makes any nice improvements or additions, please drop me a note or post a comment here. Good luck and happy compiling!


3 Responses »

  1. Google Chrome 12.0.742.122 Google Chrome 12.0.742.122 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30

    Please do something for windows

  2. Safari 5.1 Safari 5.1 Mac OS X  10.7.1 Mac OS X 10.7.1
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.1 Safari/534.48.3

    Have a new version I’ve worked on that leverages JSFL to handle some of the execution and lifting – its not exactly the same, but a good step.

  3. Google Chrome 13.0.782.220 Google Chrome 13.0.782.220 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1

    Hy I recompiled the source to work on my windows 7,
    Out the 2 jar IN your AIR LIB folder. In Flash Pro IOs settings choose “Quick publishing for device debugging” . I use I-FunBox to install the ipa quickly.