This post includes all the setup necessary to get started using the AIR SDK under Ubuntu linux. While the instructions are fairly generic and should be applicable in many circumstances, I used Adobe AIR SDK 3.9 and a fresh install of Ubuntu 12.04.3 64-bit. I like LTS releases and developers will usually be working in 64-bit environments with lots of RAM.
Note that AIR SDK 4.0 is currently in beta, and I've tested that with wine 1.7 the halfmoon compiler does improve IPA packaging time nicely. I'll do an update to this post when AIR SDK 4.0 and Ubuntu 14.04 are out.
That's it for the AIR SDK. For wine, we'll use the nice ppa:
cd /opt/ sudo mkdir air_sdk_3.9 cd air_sdk_3.9 sudo chown `whoami`:`whoami` . wget http://airdownload.adobe.com/air/win/download/latest/AIRSDK_Compiler.zip unzip AIRSDK_Compiler.zip export AIR_HOME=/opt/air_sdk_3.9 echo "export AIR_HOME=/opt/air_sdk_3.9" >> ~/.bashrc
This one may not be critical, but I found that it enabled some networking (URLLoader or Socket, I don't recall exactly) calls that weren't working otherwise:
sudo add-apt-repository ppa:ubuntu-wine/ppa sudo apt-get update sudo apt-get install wine1.7 winetricks
And if you've used wine before, you know it can be a tad too verbose in its superfluous debug messages. Quash those annoying messages with the following:
export WINEDEBUG=fixme-all echo 'export WINEDEBUG=fixme-all' >> ~/.bashrc
To setup the Windows JDK under wine, simply run the below command and leave the default settings for all questions in the setup GUI:
cd /opt sudo mkdir jvm cd jvm sudo chown `whoami`:`whoami` . tar -xvzf ~/Dowloads/jdk-7u45-linux-x64.tar.gz export JAVA_HOME=/opt/jvm/jdk1.7.0_45 export PATH=$PATH:$JAVA_HOME/bin echo 'export JAVA_HOME=/opt/jvm/jdk1.7.0_45' >> ~/.bashrc echo 'export PATH=$PATH:$JAVA_HOME/bin' >> ~/.bashrc
cd ~/Downloads wine jdk-7u45-windows-i586.exe
sudo apt-get install git cd ~ mkdir dev cd dev git clone https://github.com/jcward/BaseAIRAppLinux.git cd BaseAIRAppLinux ./compile.sh # should complete successfully with: 1118 bytes written ... ./simulate.sh # should open adl simulator window with "Hello World" TextField
ADL Simulator running in Ubuntu
sudo apt-get install alsaplayer-daemon alsa-oss alsaplayer-xosd pulseaudio-esound-compat oss-compat
Now check out how my test app's compile.sh script detects and uses it, and try it out:
cd ~/dev sudo apt-get install ruby1.9.3 git clone https://github.com/jcward/ascsh.git cd ascsh ./install.sh
cd ~/dev/BaseAIRAppLinux cat compile.sh # notice if [ if $AIR_HOME/bin/ascshd ] ./compile.sh # First compile starts ascshd, takes ~2 seconds ./compile.sh # Second compile takes ~1 seconds ./compile.sh # Third compile takes <1 seconds
ADT has built-in support for install apps, but I've never had great luck with it. Instead, I install ADB for linux. You could also install the entire Android SDK, but that's a lot of downloads. If all you want is to install you APK file over USB (you can also install it via email or web server), then just drop the 64-bit linux adb utility somewhere on your path:
cd ~/dev/BaseAIRAppLinux ./compile.sh ./package_android.sh
cd /usr/local/bin sudo wget http://jcward.com/adb sudo chmod a+x adb cd ~/dev/BaseAIRAppLinux adb devices # Should show your device plugged in via USB, if not, try: sudo adb kill-server sudo adb start-server # Then install your app: adb install -r Main.apk
There is a sweet linux package for installing .ipa files onto your devices over USB. Install and use it like so:
cd ~/dev/BaseAIRAppLinux ./compile.sh ./package_ios.sh
I've seen it return some odd errors on occasion (about missing plist files and whatnot), but usually the app installs anyway.
sudo apt-get install ideviceinstaller ideviceinstaller -i Main.ipa