Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Console.log() appearing in web browser console, but not in Android Studio console when debugging ionic app

I am trying to debug my ionic app on an Android device.

I am using console.log() to display an array:

console.log("List of recipes: " + this.recipes);

When I run the app in the web browser (ionic serve), "List of recipes" is logged to the console, & displays the array.

However, when I run this on my Android device (ionic capacitor android run -l), "List of recipes" is logged, but the array isn't.

Can someone please tell me why the array is printed out in the browser console, but not in the Android Studio console?

like image 967
user9847788 Avatar asked Dec 13 '22 10:12

user9847788


1 Answers

You can see the outputs on browser console.

Try this:

  1. Connect your device to your computer
  2. Run adb devices in command prompt/console
  3. Run Google Chrome and type "chrome://inspect/#devices" .
  4. Choose "inspect" for your app.
like image 160
Yash Avatar answered Jan 27 '23 12:01

Yash