Skip to main content
Inspiring
Oct 5, 2016 9:30 PM UTC
Answered

Tracing with logcat

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 is closed to new replies. Start a new post to keep the conversation going.
Correct answer
Oct 15, 2016 5:31 PM UTC

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.

5 replies

Inspiring
Oct 6, 2016 5:56 PM UTC

Also, USB Debugging is enabled on the phone.

Translate
Oct 8, 2016 10:39 PM UTC

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.

Translate
Inspiring
Oct 10, 2016 12:11 AM UTC

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().

Translate