Highlighted

Tracing with logcat

Contributor ,
Oct 05, 2016

Copy link to clipboard

Copied

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?

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.

TOPICS
Development

Views

1.4K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Tracing with logcat

Contributor ,
Oct 05, 2016

Copy link to clipboard

Copied

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?

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.

TOPICS
Development

Views

1.4K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 05, 2016 0
Contributor ,
Oct 06, 2016

Copy link to clipboard

Copied

Also, USB Debugging is enabled on the phone.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 06, 2016 0
Engaged ,
Oct 08, 2016

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 08, 2016 0
Contributor ,
Oct 09, 2016

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 09, 2016 0
Engaged ,
Oct 15, 2016

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2016 1
Contributor ,
Oct 27, 2016

Copy link to clipboard

Copied

You nailed it! Yes, it seems that my problem was using "Device release". Thank you so much!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 27, 2016 0