Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Cordova "console.log" entries in Android Studio

I have a Cordova app using Vue.js, and lots of logging using the standard Javascript/browser console.log(). Up until now I've only been targeting iOS, and those console.log messages appear in the xCode log viewer.

Now, however, I'm also targeting Android. I've successfully imported the Cordova project into Android Studio and the app is running in debug mode in the Emulator. But, I can't find the console.log output anywhere.

I think the log output should appear here, but there is nothing from my app at all.

enter image description here

I've also tried Logcat, as @Lukasz describes, which also had no effect:

enter image description here

like image 855
user2943799 Avatar asked Jan 27 '23 07:01

user2943799


1 Answers

You should try to use chrome inspect as described here:

https://developers.google.com/web/tools/chrome-devtools/remote-debugging/

If you really want to see the console.log statements from inside the Android Studio you can use logcat View -> Tool Windows -> Logcat. Remember to filter it by 'CONSOLE' statement like I did on the image below.

enter image description here

like image 187
Lukasz Avatar answered Jan 31 '23 19:01

Lukasz