Friday, July 23, 2010

Installing Adobe AIR (and AIR apps) on Ubuntu

The vast majority of the many twitter clients that you might like to use require you to use Adobe AIR. Installing AIR should be fine for whatever operating system you use be it Windows, Mac OS X, or Linux as you can download an installer for them all and follow the instructions (for which many people have written about).

Myself, for example, who uses the Linux distribution Ubuntu at work (version 9.10 karmic koala at the moment) should be able to download the Linux installer (the site should automatically detect which kind of operating system you have and direct you to the correct download) as a binary file (although .deb, .rpm and YUM files are also available) and install with:
>> chmod a+x AdobeAIRInstaller.bin
>> kdesudo ./AdobeAIRInstaller.bin
and then by following the on-screen instructions. This should work in theory given that I have su access on my machine, however in practice it doesn't work. This is down to the fact that Adobe AIR wants to install into the /opt directory, which in my case is not actually located on my machine, but is instead a network directory that I can't write to even as su. There seems to be no way to tell the installer to put the installation elsewhere. So, after much hardcore googling I eventually came across someone who'd had similar problems and had found a way to kind of install AIR and get AIR applications working - I found this information over a year ago and have no idea what the site was, or how to find it again (the combination of search words and how many google search pages I had to scroll through to find it escape me), so I though at least for my own benefit I'd write down what I did.

Rather than downloading the standard Adobe AIR instead download the Adobe AIR SDK (get the Linux version) - the Software Development Kit for people who want to write Adobe AIR appications. This will come as a bzipped tarball - AdobeAIRSDK.tbz2. Then just un-tar this in your directory of choice e.g. /home/username/AdobeAIRSDK:
>> cd ~
>> mkdir AdobeAIRSDK
>> mv my_download_dir/AdobeAIRSDK.tbz2 AdobeAIRSDK
>> cd AdobeAIRSDK
>> tar -xvjf AdobeAIRSDK.tbz2
That should be about it!

Now if you want to install a twitter application, for example my current choice of DestroyTwitter, then download that application, which for DestroyTwitter comes as a .zip file, and un-zip it to your location of choice:
>> mv my_download_dir/DestroyTwitter202.zip ~
>> cd ~
>> unzip DestroyTwitter202.zip
If you then look in the DestroyTwitter202 directory you will find a .air file - this is actually also a zipped file containing all the application code, so you will need to un-zip this too:
>> cd ~/DestroyTwitter202
>> unzip DestroyTwitter202.air

Now (assuming like above you've put everything in your home (~) directory) to actually run the application with Adobe AIR you can do the following from the command line:
>> ~/AdobeAIRSDK/bin/adl -nodebug ~/DestroyTwitter202/META-INF/AIR/application.xml ~/DestroyTwitter202
and all should work! (I've put the above command line into a custom application launcher in my gnome desktop panel - you can use the icons from ~/DestroyTwitter202/icons for the launcher.) When you run the application the metadata should be put into a directory within ~/.appdata.

In general it would be far easier if Adobe allowed you to install the standard AIR in a location of your choice, or it just installed into the default location of /usr that most other programs are installed to on my machine. I've also had this problem with installing chrome i.e. it want to install in /opt, which is why I just use chromium instead