AIR for Android trace() with logcat

In my previous post I talked about how to use Flash Builder 4 to debug an AIR application running on an Android device. In this post I will show a poor man's way of getting trace statements. You have to build the application with debug mode and apk-debug target packaging. Then before you run the application on the your device, connected the device to your desktop with USB debugging turned on. With that all setup run this command:

C:
> android-sdk-path/tools/adb logcat

Now run the application and you should see a bunch of android statements along with your trace statements.

Note: "android-sdk-path" is the path to your Android sdk where the adb executable will be located.

Check out the video of this process in action!

AIR for Android trace() with logcat from Renaun Erickson on Vimeo.

  • http://topsy.com/renaun.com/blog/2010/07/air-on-android-trace-with-logcat/?utm_source=pingback&utm_campaign=L2 Tweets that mention Renaun’s thoughts on AIR for Android trace() with logcat — Topsy.com

    [...] This post was mentioned on Twitter by nod(funakura). nod(funakura) said: ??????????????RT @renaun: AIR for Android trace() with logcat http://bit.ly/aYbUQT [...]

  • http://flashmobile.scottjanousek.com/ Scott Janousek

    Tip … you can use adb logcat piped with a grep to remove all extraneous info coming from a plugged Android device (and maybe even the emulator, haven’t tried).

    Example: adb logcat | grep ‘~ ‘

    Then just prefix your trace statements with “`” or whatever other string you can uniquely use within logcat (I used ‘~’ for simplicity).

    trace( ‘~ ‘ + myVar );

  • http://flashmobile.scottjanousek.com/2010/08/08/debugging-with-air-for-android-video-tutorials/ Scott Janousek » Blog Archive » Debugging with AIR for Android (video tutorials)

    [...] He also chronicled this on his blog, about debugging AIR apps on Android device with Flash Builder, and in an adb and logcat post. [...]

  • http://www.flashlounge.net/workflow/2010/android-air-development-using-ant-adt-for-fdt-4/ Android Air development using Ant & ADT for FDT 4

    [...] guaranteed your going to be tired of clearing LogCat’s Log screen. So after stumbling on Scott Janousek’s comment on Renaun Erickson’s blog I can see just how helpful his tip is. Essentially all you do when [...]