Skip to main content
Inspiring
October 5, 2016
Answered

Tracing with logcat

  • October 5, 2016
  • 1 reply
  • 2248 views

I've been trying to trace an Air app on Android devices using logcat (on a Windows 10 PC). Logcat shows a lot a output, but nothing from my app. I have "permit debugging" checked in Publish Settings. Anything else I could have missed?

This topic has been closed for replies.
Correct answer

I'm following these instructions: Adobe AIR * Trace statements

There's nothing about using ANEs. I may be wrong, but it seems that it's supposed to work by just using trace().


My apologies on taking a while to get back to you. I just moved to a new state and it took a while to get settled in. I followed the instructions and made a few guesses from the link you provided and I was able to see trace statements in LogCat as well as within Flash with the Android app running on an actual device. My steps:

1) Created a new AIR Android app

2) Added a setInterval() that fired every 2 seconds with a callback function simply containing a trace("Hello World") action.

3) Changed the "Android deployment type" to "Debug". This screen can be found under the "Deployment" tab in the "AIR for Android Settings". This causes the app to always want to connect to a debuggable IP address whenever you launch the app. You use this to debug the app within Flash using the Debug -> Begin Remote Debugging Session menu option.

4) Publish the app to a device

5) Open Command Line and "cd" to the "adb" file located under (AIR SDK folder) -> lib -> android -> bin

6) In Command Line, type: adb logcat air.MyApp:I *:S

The "MyApp" should be replaced with your apps "App ID". After that, you should see any trace statement in your app as they fire. If your app is published with the deployment type of "Device release", then it will not work. I suspect that was problem keeping you from seeing them. The "Permit Debugging" checkbox under the general Publish Settings doesn't affect this as mine was unchecked by default.

When you launch the app on your device, you will see it trying to connect to a debug IP address. You can simply click cancel on the popup and it will still be able to see the trace statements in Command Line.

1 reply

Inspiring
October 6, 2016

Also, USB Debugging is enabled on the phone.

October 8, 2016

What method are you using to try and log messages in LogCat? This likely requires the use of a native extension for actual log messages to appear in LogCat.

Inspiring
October 10, 2016

I'm following these instructions: Adobe AIR * Trace statements

There's nothing about using ANEs. I may be wrong, but it seems that it's supposed to work by just using trace().