How to debug Air apps on an Android device with captive runtime?.

I'm new to Android development, and I'm trying to debug an Air app on the device, I'm doing the same procedure I did when I made this app for iOS:

- click debug
- the app installs on the device
- a popup asks me if I thruts the PC
- after clicking OK the app starts and I can see debug info


However, this on an Android device seems to be a little bit different, since after I click debug the device asks me to install Air, so I assume it's not included as captive runtime just like in iOS.

If this is true, then I supose I have to install Air manually to debug, is that right?, if so, are there any differences? (captive version against the manually installed).

Thanks.

7 comments
Comment actions Permalink

When you create release version of your APK via Build | Package AIR Application you have an option whether to include AIR runtime in the resulting APK (captive runctime) or not.
When debuggable version of APK is created you do not have such option and different versions of AIR SDK have different behavior: some include captive runtime, some not. So looks like for debugging you need to install AIR runtime. You do it either following the link shown on the device or by executing from the command line: adt -installRuntime -platform android. To uninstall old version of AIR runtime or just to clean the device: adt -uninstallRuntime -platform android

0
Comment actions Permalink

Alex, thanks, yes after some googling I've figured that debugging ina in Android was a little bit different than in iOS, and I need shared runtime for that.

However, I've found something strange, after uninstalling Air in the device (three dots->uninstall apps->click on Air) it seems like it's still installed, because when I debug the app it doesn't ask for Air.

Is this normal?.

0
Comment actions Permalink

Another way to check if AIR Runtime is installed on the device - run from command line: [AIR SDK}/bin/adt -runtimeVersion -platform android
APK with captive runtime do not need separate Runtime installation, APK without it - do need. I have nothing to add here.

0
Comment actions Permalink

Hi,

Did you ever figure out a way to debug using the captive runtime, currently seems it's only possible to package the application using it, but debug builds are all done with the shared runtime?

Cheers

0
Comment actions Permalink

Intellij IDEA uses ADT tool from the AIR SDK to create APK file. Here's its documentation: http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac1e63e3d128cdca935b-8000.html
There's a choice for release bundles: one can use either 'apk' or 'apk‑captive‑runtime' target.
But I do not see any options that would allow controlling whether 'apk-debug' target should include captive runtime or not. ADT seems to decide it itself. Do you know undocumented ways to create debuggable APK with captive runtime using the ADT tool?

0
Comment actions Permalink

Hi, 

There are several more outputs than just apk and apk-captive-runtime! In particular the apk-debug is what you should be using for debug builds.

Please read the android packaging documentation: http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac-4f1413de12cd45ccc23-8000.html

This indicates that by default the `apk-debug` format will use the captive runtime packaging, unless you set the AIR_ANDROID_SHARED_RUNTIME variable

Note: By default, ADT packages a captive copy of the AIR runtime with your Android app while packaging app with apk-debug target. To force ADT to create an APK that uses an external runtime, set the AIR_ANDROID_SHARED_RUNTIME environment variable to true.

 

0
Comment actions Permalink

> apk-debug is what you should be using for debug builds

Sure, IDE uses it.

> by default the `apk-debug` format will use the captive runtime packaging

But your experience shows that it is not the case, right?

> the AIR_ANDROID_SHARED_RUNTIME variable

Good catch! I think setting this env var globally on your OS and restarting the IDE will do the trick.
Setting the env var for the IDE only should also do the trick because child ADT process inherits it.

0

Please sign in to leave a comment.