Android Studio and Capacitor cannot finde console.log() output
Asked Answered
U

1

13

I have a Angular Application that i converted via Capacitor to a Android App. If i start my app in Android Studio i cannot access my Nodejs. Therefor i want to use the console.log() to see where my problem is.

But i cant find an output of my log, even though its there in the web console.

Unintelligible answered 9/6, 2021 at 9:39 Comment(0)
P
24

You can see Capacitor logs in two different places.

  1. Chrome remote inspector, just type this in your Desktop Chrome chrome://inspect/#devices and your device should appear there and a list of webs and apps that can be debugged, choose your app and you'll see all the console.logs there.
  2. Logcat. Inside Android Studio on the bottom on the screen there should be a Logcat section, if you click it it should show console.log messages and also native messages.
Proteolysis answered 10/6, 2021 at 11:32 Comment(6)
After entering chrome://inspect/#devices - how do I "choose your app" from here? They don't seem clickable? Thanks!Cleveite
is your app running? in the screenshot I don't see any apps listedProteolysis
I have it running inside Android Studio (Arctic Fox).Cleveite
You should see something like, 'Android SDK built for x86 #EMULATOR-5554' and then a link will show up under it stating, inspect. This will allow seeing console messages.Arabelle
I can see my app in the inspector, but still not seeing any console.logsCordellcorder
Maybe you have some plugin that disables logs or some build step that removes them. Capacitor, on Android, does nothing with the console.log object.Proteolysis

© 2022 - 2024 — McMap. All rights reserved.