Clever Adobe compilation trick sneaks Flash apps onto iPhone
By Scott M. Fulton, III | Published October 7, 2009, 4:52 PM
Up to now, Apple's prohibition against anyone's runtime modules from appearing on its iPhone without authorization has been one of two central reasons that Adobe's Flash video and Flash platform have not made their appearance there -- the other reason being simply that Steve Jobs doesn't like it.
But at its annual MAX developers' conference in Los Angeles this week, Adobe's engineers unveiled a surprise: It's planning a public beta release of Flash Professional CS5 that will go through a new and unique set of hoops to enable developers to write or export apps built for the Flash runtime, to run on the iPhone as native apps. The new Flash Pro will use a mechanism for Flash application developers to deploy their apps on the iPhone anyway, even without the Flash mobile runtime.
That mechanism is the evolution of an academic project -- namely, the work of the Computer Science Dept. at the University of Illinois-Champaign. It's an open source project called Low-Level Virtual Machine (LLVM), and it's a way to effectively bury the compilation element of a language interpreter below the application layer where the runtime module normally resides, deep into object code.
"On the iPhone, we don't have a browser plug-in. Flash Player 10.1 isn't available, and you can't browse to this application and just start using it," explained Adobe engineer Adrian Ludwig, in a company video released during MAX.
"So what developers have to do is go inside of Flash Pro, and they have to export that project to a native application for the iPhone. While you're using Flash Pro to build these applications, it's being converted from SWF down to IPA, which is the native file for applications on the iPhone. So it's installed -- there's no runtime interpretation, there's no JIT. These are applications that are built according to all of the rules that have been established in the iPhone developer program."

Seven Flash games have already been developed for iPhone, and have begun distribution this week through Apple's App Store -- a clear indication that these apps do follow Apple's rules.
As Aditya Bansod, another Adobe engineer, blogged on Monday, "We created a new compiler front end that allowed LLVM to understand ActionScript 3 and used its existing ARM back end to output native ARM assembly code. We call this Ahead of Time (AOT) compilation -- in contrast to the way Adobe Flash Player and Adobe AIR function on the desktop using Just in Time (JIT) compilation. Since we are able to compile ActionScript to ARM ahead of time, the application gets all the performance benefits that the JIT would offer and the license compliance of not requiring a runtime in the final application."
The downside of this architecture is that the hoops Apple made Adobe jump through, bypass the normal route an iPhone app would take to communicate with the iPhone itself. As a result, much of the iPhone API is inaccessible from within an exported Flash app; although Flash evangelist Mark Doherty presented an initial list of iPhone features that will not work in a Flash app, one gets the distinct feeling that it's not yet even an exhaustive list.
Which limits the class of Flash apps one can port to the iPhone to mostly games; and indeed, that's the focus of the first seven such apps that Adobe is demonstrating. As for rerouting Adobe's ingenious detour closer to the phone itself in the future, Doherty pointed to a future version of the company's Flex Mobile Framework, whose code-name "Slider" gives you a hint as to where it's directing at least one offshoot of its platform.
While it's interesting, hopefully developers will find a way to develop native applications and bypass Adobe's software completely.
Other than Adobe, no one *needs* Flash. It's a drain on system resources, no matter the platform.
Score: 0
|Steve Jobs getting more cranky with age
Score: 4
|"Seven Flash games have already been developed for iPhone, and have begun distribution this week through Apple's App Store -- a clear indication that these apps do follow Apple's rules."
That line right there is more and more hilarious each time I read it. Flash games, on the App Store, for a device that Apple refuses to allow Flash to run on... and they're not being rejected.
Well, it's clear that these do not duplicate functionality. =)
Score: 0
|I believe Apple will find a way to not let this happen on the platform. Looking at the bigger picture one can see that Apple has gained its popularity among the developer community. Many developers have migrated to the Apple because it is necessary to have XCode which runs only on OS-X. This helps sell machines.
The ability to have iPhones apps compiled outside of the Apple OS-X is going to change this. I think there will be more of a stink before this is over. Apple has built a strong development community that takes pride in their newly acquired skill set.
A good way for Apple to circumvent this would be to have an ECME script attached to Quartz with an adaptation layer that emulates Flash functionality. This would allow for easier migration of Flash Apps to the iPhone and still require an Apple machine to compile the code.
my 3 cents
Score: 0
|It's because they aren't "Flash" games. They were developed using Flash, but they are running on the iPhone as 100% native apps. It's more like a framework that allows you to develop in Flash, which a lot of developers are comfortable with, on your own machine, then turn it into a native app for the iPhone.
Still, I don't think it's clear that Apple *likes* this--you don't get native widgets, and Apple seems to have made it clear in the past that they don't like frameworks. But there's nothing about this that makes it actually Flash running on the iPhone.
Score: 0
|