Introduction
Linux as a system for work, I use recently. Previously worked in Windows. The reason for the transition is very simple and banal - tired of the glitches and lags of Windows. I develop applications using Adobe Flash and Adobe AIR technologies for both web and Android. Therefore, during the transition it was very important to decide whether I could work in Linux as productively as in Windows. Having rummaged on the forums and on the official website, I learned that FlexSDK is supported, but the support for AIR has ended since version 2.6. Sad however. But we also have the opportunity to run windows-applications in the Linux environment, why not take advantage of this. This article is just about how to configure Linux work with AIR SDK 3.6 - the latest version at the time of publication.
I have ArchLinux installed on my computer, so all the actions described in this article will be considered for this distribution. In other distributions, you may need to enter slightly different commands to perform these operations, but the sequence of commands will be exactly the same.
The commands given in the article will begin with the symbol $ or #. If a command starts with $, such commands need to be run as a regular user. If the command begins with #, these commands need to be entered only from the root. Be careful!
WINE
On Linux, there are not so many ways to run an application for Windows. One of the most common solutions is to use wine. Additional information on this software can be found on the Internet, for example, here
http://www.winehq.org .
So, first we need to install wine, if it is not already installed. Usually, the package is called wine, but if it is not in your repository, you can download it from the official site as source code and compile it on your computer. The package installation command in ArchLinux looks like this:
# pacman -S wine
After its execution from the repository, the ready-to-run wine will be downloaded and installed. We just need to adjust it a bit. Run wine and everything connected with it, you need only as a normal user and in any case not from the root. To set up wine there is a special program that is launched by the command:
$ winecfg
After executing this command, a menu will appear where you can configure some wine parameters. From the default settings, I changed only the version of the operating system from Windows XP to Windows 7, left everything else as is. It is also important to check that the Z: drive is created in the "Disks" tab, pointing to the root directory. It looks like this to me:

You will need this disk when setting up a script to run the AIR debugger, which will be mentioned later. If everything is ready, click OK and exit the configurator. Now that wine is set up, you can install FlexSDK and the AIR SDK.
FlexSDK and AIR SDK
If you have not yet installed FlexSDK, you must first install it. I installed it from the user repository AUR. If there is no FlexSDK in the repository of your distribution, it can be downloaded from the official Adobe website at this link
www.adobe.com/devnet/flex/flex-sdk-download.html . So, install from AUR:
$ yaourt -S flex-sdk
After installing the SDK from AUR, it will be located in / opt / flex-sdk. Next, download the AIR SDK from the official Adobe website
http://www.adobe.com/devnet/air/air-sdk-download.html . We need a version for Windows:
$ wget -P ~ airdownload.adobe.com/air/win/download/latest/AIRSDK_Compiler.zip
The specified command will download the file to the home folder. Next, we need to unpack it and copy it to the folder with the installed FlexSDK. Go to the home folder and unpack the archive. You can unpack the archive using the file-roller program, a GTK-based archiver with a graphical interface, or with the unzip console utility. Suppose you unpacked it into the folder AIRSDK_Compiler, which was saved in your home directory. After unpacking, we roll the contents of this folder onto the folder with FlexSDK:
# cp -R ~/AIRSDK_Compiler/* /opt/flex-sdk
If your FlexSDK is installed in a folder other than / opt / flex-sdk, then of course you specify your destination folder. After copying the folder AIRSDK_Compiler, you can delete it, we will no longer need it, the entire set of files has already been copied to FlexSDK.
')
ADL, AAPT and ADB
All AIR SDK, like FlexSDK, is written in Java, that is, it is cross-platform and can function on any system for which the JRE exists, including Linux. However, the AIR SDK does not have linux versions of the following programs: debugger (adl), packer (aapt), and bridge program for debugging (adb), and without them you can’t run and build anything.
ADL (Adobe Debug Launcher) is a debugger used to debug applications and launch them.
AAPT (Android Asset Packaging Tool) is a packer for building applications, libraries and resources into a single apk-file.
ADB (Android Debug Bridge) is a bridge program for debugging and remote control of an Android emulator or a real device based on this system. Since I did not find another sane translation for this program, later in the article I will call this program simply a “bridge”.
In the SDK, all three programs are present for only two operating systems: Windows and Mac OS. Therefore, to launch the debugger, we will use wine, a packer and a bridge from the Android SDK Platform Tools, since both of these programs for Linux are present in this software package.
Android SDK Platform Tools
This is a set of programs that simplify the development of applications for Android. It contains two programs we need: packer and bridge. I installed it from AUR too. The default set is installed in / opt / android-sdk / platform-tools.
$ yaourt -S android-sdk-platform-tools
In the absence of such a package in the repository of your distribution, it can easily be downloaded from the official site
http://developer.android.com/sdk/index.html .
Run ADL
As a development environment, I use Intellij IDEA. How to configure it to use our newly installed FlexSDK is not described in the article, since the reader is probably savvy in such questions if it reads this. We will assume that you have already done this and in your test AIR project, the newly installed FlexSDK is used. When compiling an AIR project, this environment tries to start the debugger along the path 'folder_c_flex_sdk / bin / adl'. Assuming that the FlexSDK is installed in the / opt / flex-sdk folder, the full path will be / opt / flex-sdk / bin / adl. Now there is an executable file for Windows adl.exe. To get him to do our tasks, we need to do the following:
1. The Windows debugger understands as a path only the paths of the type “C: \ directory \ path_to_file”, when building a project under Linux, the path to the file is “/ directory / path_to_file". That is, we need to bring the second to the first in order Understand us and run the file we need. This is where the Z: drive is useful, which in wine points to the root directory of the operating system.
2. You need to pass to the debugger all the parameters that were passed from the development environment.
To solve this problem, we will create a script that will do two things: 1. Convert the file path from the windows version to the linux version, so that the path points to the real file in the system; 2. Run the debugger under wine with the same parameters with which this debugger tries to launch the nama development environment. I have already written a draft version of such a script in bash and post it here. It is quite simple:
!#/bin/bash
wine /opt/flex-sdk/bin/adl.exe ${@//\/home/\Z\:\/home}
Now it is designed for the fact that all your projects are in your home directory, which is not always the case. The script clearly needs some work, but I still don't physically have enough time to bring it to mind. I would be very grateful to everyone who will help unify it.
To save the script, go to / opt / flex-sdk / bin. There is already a Mac OS version of the adl file. You can simply delete this file:
# rm /opt/flex-sdk/bin/adl
Instead, create a new empty file:
# touch /opt/flex-sdk/bin/adl
Open it in any text editor (I use nano):
# nano /opt/flex-sdk/bin/adl
and paste the above script lines above. Save and exit the editor. It remains to make the file executable. To do this, assign him the right mask 755:
# chmod 755 /opt/flex-sdk/bin/adl
After that, the file is ready for use.
Linking AAPT and ADB
The packer runs along the path / opt / flex-sdk / lib / android / bin / aapt. Go to the / opt / flex-sdk / lib / android / bin folder and see that there is also an aapt-file here and it is also compiled for Mac OS. Delete it:
# rm /opt/flex-sdk/lib/android/bin/aapt
In its place should be a file from the Android SDK Platform Tools, so we simply create a symbolic link to the executable file of the packer / opt / android-sdk / platform-tools / aapt. You can do this with the following command:
# ln -s /opt/android-sdk/platform-tools/aapt /opt/flex-sdk/lib/android/bin/aapt
Similar commands need to be executed for the bridge:
# rm /opt/flex-sdk/lib/android/bin/adb
# ln -s /opt/android-sdk/platform-tools/adb /opt/flex-sdk/lib/android/bin/adb
That's probably all. Congratulations, you can now develop AIR applications for Android on Linux using the latest version of the AIR SDK!
Summary
I managed to make the debugger work under wine, debugging works completely: breakpoints work, the contents of variables are displayed, etc. But I still haven't had time to check some things. For example, how applications using Stage3D will work in such a debugger, did not try to debug the application on a real device, and maybe something else. As soon as I do this, I will definitely add an article if there is such an opportunity. I will also be grateful to everyone who can deal with the assembly of AIR-applications under iOS, since I have not done this either.
Conclusion
I really hope that this information will be useful to someone. When I ran into this, I did not find any sane decision on the network. I had to dig myself. And when I figured it out, I wanted to share this with everyone. I really like Linux, its stability, openness, unlimited possibilities in setting up this platform. Sadly, the low prevalence of the system among ordinary users, in part because of the lack of versions of various software for this particular OS. Perhaps, after reading this article, part of the developers who were prevented from switching to this OS from the absence of the Linux SDK would try to do it again. May the penguin's power come with you! )