Creating Windows Mac or Linux executable file from AIR file

This post is regarding how we can create executable from AIR file targeting a specific OS platform. Flex or Flash builder doesn’t give us the functionality to create executable, we have to use command line Air compiler to create executable. As of now we can create executable targeting 3 major platform i.e. Windows, MAC and Linux. Until now i.e. before version 2 of AIR it wasn’t possible in AIR. We simply create a single AIR output file and can install/deploy it on any platform using AIR framework. But then we couldn’t call up native processes in the host operative system in AIR and it turned out to be a very less effective desktop application. So because of huge demand from community Adobe has come out with AIR 2, which  has native process class in AIR among few other enhancements. But this additional feature has downside as well and that is we have to create separate executable for each 3 major supported OS i.e. Windows, MAC and Linux. 2nd if it’s a executable we can’t update it directly from Server like we use to do for AIR apps.

How can be create executable from AIR app:
Goto command line
Move to AIR SDK installed folder>bin
command to create executable is:

adt -package -target native <output executable file path with output file name>
<input air file path with input air file name>

Examples:

Windows executable:
adt -package -target native C:\AIRSamples\AIRSample.exe C:\AIRSamples\AIRSample.air

Mac executable:
adt -package -target native C:\AIRSamples\AIRSample.dmg C:\AIRSamples\AIRSample.air

Linux executable:
adt -package -target native C:\AIRSamples\AIRSample.rpm C:\AIRSamples\AIRSample.air

Preparing the app as a native application

In order to use the new NativeProcess class in your application you need to add one line to your application descriptor file:

<supportedProfiles>extendedDesktop</supportedProfiles> tag and you must add “desktop” for desktop version as well to it i.e.
correct format is:<supportedProfiles>extendedDesktop desktop</supportedProfiles>
Otherwise you will get an Error:306-
“Descriptor must support the profile desktop, mobileDevice, or extendedMobileDevice while creating release version of your AIR project”.
 
Advertisements

5 thoughts on “Creating Windows Mac or Linux executable file from AIR file

  1. To create Linux installers you have to used adt in a Linux machine. On a deb machine you will be able to create deb installers and on an rpm machine you will be able to create rpm installers.
    -Thanks
    Sundeep

    • I was able to create dmg and rpm files on windows command line. Although I didn’t try to execute them on their respective OS.

    • Although I found it mentioned in the AIR Help the following text :

      You must use ADT on the same operating system as that of the native installer file you want to generate. So, to create an EXE file for Windows, run ADT on Windows. To create a DMG file for Mac OS, run ADT on Mac OS. To create a DEB or RPG file for Linux, run ADT on Linux.

      It would be great if someone can comment here on what if someone wants to create executable for other OS why can’t he do that in his own native OS? or what impact it will have on the final outcome when installed/to be installed on that particular OS.

      Thanks,
      Vivek.

  2. Thanks for this information.

    I have a problem when I try and generate an .rpm file from an .air file on Linux.

    I get:

    [root@centos5 ~]# adt -package -target native /opt/flex/JEPUMLim.rpm /opt/flex/JEPUMLim.air
    AIR file at /opt/flex/JEPUMLim.air could not be converted.
    The error was ”
    (/opt/flex/air/lib/nai/bin/naip:10026): Gtk-WARNING **: cannot open display:

  3. But but, Linux native Installer ( It should find good suggestion )

    deb or rpm files are crazy becasue you have a lot of works. I wish better *.bin file when Ubuntu or OpenSuse.. If you do not like problem when Native installer example native-installer-air.bin will all linux system to be complete.

    If you like better than rpm and deb files. I think sure when linux can open *.bundle or *.bin

    What is this favorite file extension for Linux System? *.bin really? or *.run Files?? If any Linux Systems can open important file?

    Thanks for advanced example for Linux!!

Comments are closed.