"Compiling and Running an AIR application on Linux (using sdk) is same as how you do it on Windows". If you have Flex Builder, you dont have to worry about this. BTW, this post is only for beginners on AIR. If you want to compile and run the app using the sdk (terminal on linux, cmd on windows), Here is how you do that.
a) Get the SDK downloaded to a locatoin (ex: /home/username/flexsdk/)
b) If you are installing Flex Builder Linux Alpha 3 (to be released in labs around 31 March), you have an inbuilt sdk in your install location (ex: $INSTALL_LOCATION/Adobe_Flex_Builder_Linux/sdks/3.0.0)
c) Use the "amxmlc" - AIR MXML compiler present in your sdK (ex: $INSTALL_LOCATION/Adobe_Flex_Builder_Linux/sdks/3.0.0/amxmlc)
d) Assuming you have created an AIR MXML Application with its application properties file AIR XML file. (locatoin ex: /home/username/AIRApps/FirstAirApp/MyApp.mxml, MyApp-app.xml)
e) You will have to find AIR runtime directory (if you have installed Flex Builder on Linux alpha 3, Then runtime directory = $INSTALL_LOCATION/Adobe_Flex_Builder_Linux/sdks/3.0.0/runtimes/air/Linux),
e) Open your Terminal (cmd prompt on windows)
To Compile your MXML File
f) $localhost@terminal>"$INSTALL_LOCATION/Adobe_Flex_Builder_Linux/sdks/3.0.0/bin/amxmlc" <space> /home/username/AIRApps/FirstAirApp/MyApp.mxml
g) It will generate a SWF file with the same name in your directory (from where you are compiling)
Configure your *-app.xml to point it to the generated SWF
h) Open the application descriptor file "/home/username/AIRApps/FirstAirApp/MyApp-app.xml" (either in vi editor or in text editor), Find the string "[This value will be overwritten by Flex Builder in the output app.xml]" with in the tags <content> nested inside <initialWindow>. Remove the string present in the <content>...</content> and replace it with the path to the SWF file generated after you have compiled it. (example: <content>/home/username/....../Myapp.swf</content>). Save the file.
Running your air app:
i) In Your terminal run the command :
localhost@username> $INSTALL_LOCATION/Adobe_Flex_Builder_Linux/sdks/3.0.0/bin/adl_lin <space> -runtime <space> $INSTALL_LOCATION/Adobe_Flex_Builder_Linux/sdks/3.0.0/runtimes/air/Linux <space> /home/username/AIRApps/FirstAirApp/MyApp-app.xml
There you go... Your AIR App is launched for you.
PS:Please note that AIR Runtime (packaging/installing air apps etc.) does not come with Flex Builder Linux installation. You can get AIR Runtime for Linux on labs once again.
0 comments:
Post a Comment