***Update: Use package.blackberry OR install.blackberry when running the ANT task, using both will overwrite the BAR file and remove signing. Verify your BAR is signed by renaming it from app.bar to app.zip, extract and ensure you have META-INF/AUTHOR.EC and META-INF/RDK.EC included in the zip.***
Create your market ready AIR apps for iOS, Android and the BlackBerry PlayBook in a single click using the same code. This ANT task compiles, signs and pushes out to attached devices (iOS requires dragging into iTunes). All of the signed apps created with this ANT task can be published to the market.
Overview:
The AIR 2.6 SDK is great but doesn’t have full Flash Builder support yet. This ANT task can be used in Flash Builder, Flash Develop, FDT or even the command line. Using Flash Develop, you can create apps for all devices without paying for expensive software!
Pre-requisites:
You will need to install Flash Builder Burrito, the BlackBerry PlayBook SDK, the AIR 2.6 SDK and acquire signing keys for all three devices. If using Flash Develop, you will need to follow some additional steps for ANT integration. You’ll also want to download the base project from Google Code: http://code.google.com/p/air-mobile-tools/
Video Tutorial:
Wiki:
The wiki on Google code contains more information on getting started with this base project: http://code.google.com/p/air-mobile-tools/wiki/BaseMobileActionScriptProject
ANT Task:
[XML]
[AS]
flex.path = C:/Program Files (x86)/Adobe/Flash Builder Burrito/Adobe Flash Builder Burrito/sdks
flex.sdkVersion= 4.5.0_air
flex.sdkPath= ${flex.path}/${flex.sdkVersion}
FLEX_HOME= ${flex.sdkPath}
BB_HOME = ${flex.path}/blackberry-tablet-sdk-0.9.4
contentText = [This value will be overwritten by Flash Builder in the output app.xml]
ADB = C:/Users/Chris/Desktop/Froyo/android-sdk-windows/platform-tools/adb.exe
ADT = ${flex.sdkPath}/bin/adt.bat
adt.path = ${flex.sdkPath}/bin/
IPHONE_PACKAGER = adt
BBDeploy = ${flex.path}/blackberry-tablet-sdk-0.9.4/bin/blackberry-deploy.bat
BBPackager = ${flex.path}/blackberry-tablet-sdk-0.9.4/bin/blackberry-airpackager.bat
BBSigner = ${flex.path}/blackberry-tablet-sdk-0.9.4/bin/blackberry-signer.bat
bb.ip = [PLAYBOOK_IP]
bb.password = [YOUR_PASSWORD]
## Directories
build.dir = bin-release
dev.dir = ${basedir}/src
cert.dir = ${basedir}/certs
app.name = BaseMobileActionScriptProject
## mxml or as
app.type = as
## Apple cert info: ipa-test | ipa-debug | ipa-app-store | ipa-ad-hoc
apple.target = ipa-ad-hoc
apple.cert = [APPLE_CERT_NAME].p12
apple.cert.password = [CERT_PASSWORD]
apple.provision = [PROVISION_NAME].mobileprovision
apple.descriptor = ${dev.dir}/${app.name}Apple-app.xml
## Android cert info
cert = [ANDROID_CERT_NAME].p12
cert.password = [YOUR_PASSWORD]
## PlayBook cert info
bb.cert = [BB_CERT_NAME].p12
bb.cert.password = [YOUR_PASSWORD]
bb.store.password = [YOUR_STORE_PASSWORD]
bb.descriptor = ${dev.dir}/${app.name}BlackBerry-app.xml
## General
swfFile=${build.dir}/${app.name}.swf
projectFile=${dev.dir}/${app.name}.${app.type}
[/AS]
Resources:
http://www.terrenceryan.com/blog/post.cfm/using-ant-to-package-the-same-air-app-to-multiple-devices
http://technophi.com/2011/03/08/using-ant-to-compile-a-flex-mobile-project-for-ios/
http://www.adobe.com/devnet/flex/articles/flex_ant_pt1.html
http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ffb.html
Tags: Android, BlackBerry, iOS, PlayBook







Ken Sykora
April 4th, 2011
Do like!
FlexVN » iOS, Android and BlackBerry with ANT build
April 4th, 2011
[...] Chris Black post a video tutorial show how to use ANT to build iOS, Android and BlackBerry app with Adobe AIR 2.6 [...]
maru
April 5th, 2011
That’s awesome ! Thank you Chris
Slav
April 5th, 2011
Very nice!, thanks for this, already have ant script for publishing to Android and was about to write one for iOS and now I don’t have to !
Nilsh
April 5th, 2011
This looks great – thanks! Instructions seem clear too, I’m going to give it a go in a bit
Nate Pacyga
April 5th, 2011
Great work Chris! Thanks for putting this all together. Very useful!
Nilsh
April 6th, 2011
Hey Chris,
This has saved me lots of time
I noticed that the Android Certifcate name is hardcoded in the “package.android” target:
<copy file="${cert.dir}/androidcert.p12" …
Also the path to ADB in your properties is on your desktop, but it is available in the AIR and Blackberry SDKs.
Donaldini
April 7th, 2011
Nice article.
I tried to run your “BaseMobileActionScriptProject”, but my Burrito gave me this error when imported:
Unknown Flex SDK: “Flex 4.5 AIR 2.6″
Resource(BaseMobileActionScriptProject)
Chris Black
April 7th, 2011
You’ll need to make a copy of your Flex 4.5 SDK folder and add in AIR 2.6. Add that new SDK location into Flash Builder Burrito and you should be good to go. The new version of Flash Builder will ship with the latest version of AIR making this process much easier.
Donaldini
April 8th, 2011
I already tried doing that a couple of times, but I might be doing something wrong?
I made a quick screencap video to check: http://www.youtube.com/watch?v=zdpkUNBZESU
There’s also another error that could be related, as shown in the video.
Chris Black | blackcj.com: iOS, Android and BlackBerry in a Single Click with ANT « Geek Devigner
April 10th, 2011
[...] via Chris Black | blackcj.com: iOS, Android and BlackBerry in a Single Click with ANT. [...]
Get Geeky – Day 1 « The Lab @ Neo-Pangea
April 19th, 2011
[...] there’s more space for developers to fill niches with new products). But the big finale was using Apache Ant to deploy AIR apps across Android, iOs, and BlackBerry mobile devices… AT THE SAME TIME! We’ve been [...]
Chris Black
April 21st, 2011
Thanks for posting the video. It’s possible that Flex builder isn’t updating the properties file correctly. You could try creating a new project and copying the files (minus the FB specific settings) into that project. The ANT script should actually still work regardless if the settings.properties file has been filled out correctly.
Chris Black
April 21st, 2011
Thanks Nilsh. I’m working on some updates to this script to improve device testing for the PlayBook (now that I actually have a device) and will include your feedback as well.