Device Debug Assistance.

Hi Guys.

Have some code doing some inexplicable things.  Works fine in the simulator, but the compiled debug version on my device behaves differently.

I’m using a Samsung Galaxy Note 8 and have it in developer mode of course…      I don’t know how to see debug info on the phone - which is making the debug process extremely difficult.

I can print any value out to the console in the Simulator, but once compiled and installed on my phone, how do I see the same debug data?

Is there any tutorial (within Corona - or outside) on how to access the device’s debug info?

Thanks for any assist…

I’m not sure if there’s a more ‘proper’ approach, but I used to do native Android dev using Android Studio, and before that, Eclipse SDK. Both included a console at the bottom of the screen that spat out all of the debug info from your device while it was USB’d in - not just for the app you’re working on - you just need the device to be in developer mode which you’ve done already. Very handy for watching how intents talk to each other and what the sensors are reporting.

Presumably if you just open one of these IDE’s, USB in, and run your app, you’ll see the console outputs that the simulator shows. I’ve not tried myself though and again, there might be a better solution that I’m unaware of.

From memory I THINK Eclipse had a filtering option so that you didn’t get bombarded with absolutely everything - I believe you could toggle the app that the console listened to. That might have only been for apps Eclipse was telling the device to launch though as opposed to everything the device was running. It’s been a while, and my memory sucks.

You might want to read https://docs.coronalabs.com/guide/basics/debugging/index.html#device-debugging-android.

If you’re on a Mac, this is really, super simple. Build for Android and choose to have the simulator install the APK to your device when the build is finished. You, of course, will have to have the device plugged into your USB port. When the build finishes, it will present a dialog box saying it was installed and something about your console log. Do not close that dialog. Now switch to the Corona console window and your device’s console log will be routed to the Corona console log and you can easily see the device’s messages.

If you’re not on a Mac (and this also works on a mac) is to installed the Android Debug Bridge tools, which @XeduR refers to in the link above. If you’re already using “adb” to install your app on your device, then you can simply do “adb logcat” to view the device’s console log.

You ****may**** be able to get Android Studio to show you the console log as well, but I don’t know how to make that happen.

Rob

I’m not sure if there’s a more ‘proper’ approach, but I used to do native Android dev using Android Studio, and before that, Eclipse SDK. Both included a console at the bottom of the screen that spat out all of the debug info from your device while it was USB’d in - not just for the app you’re working on - you just need the device to be in developer mode which you’ve done already. Very handy for watching how intents talk to each other and what the sensors are reporting.

Presumably if you just open one of these IDE’s, USB in, and run your app, you’ll see the console outputs that the simulator shows. I’ve not tried myself though and again, there might be a better solution that I’m unaware of.

From memory I THINK Eclipse had a filtering option so that you didn’t get bombarded with absolutely everything - I believe you could toggle the app that the console listened to. That might have only been for apps Eclipse was telling the device to launch though as opposed to everything the device was running. It’s been a while, and my memory sucks.

You might want to read https://docs.coronalabs.com/guide/basics/debugging/index.html#device-debugging-android.

If you’re on a Mac, this is really, super simple. Build for Android and choose to have the simulator install the APK to your device when the build is finished. You, of course, will have to have the device plugged into your USB port. When the build finishes, it will present a dialog box saying it was installed and something about your console log. Do not close that dialog. Now switch to the Corona console window and your device’s console log will be routed to the Corona console log and you can easily see the device’s messages.

If you’re not on a Mac (and this also works on a mac) is to installed the Android Debug Bridge tools, which @XeduR refers to in the link above. If you’re already using “adb” to install your app on your device, then you can simply do “adb logcat” to view the device’s console log.

You ****may**** be able to get Android Studio to show you the console log as well, but I don’t know how to make that happen.

Rob