7

I am debugging some service worker stuff in Chrome for Android, and I have a bunch of "console.log" statements that would tell me what's going on. However, on Android, I can't find these logs anywhere (I don't see them in "adb logcat" and they don't show up in a bug report).

The main thing that I'm trying to debug is push notifications. My service worker is creating a notification just fine, but the series of events that happens when I click on the notification is nebulous. Hence my copious "console.log" statements to help me figure out what's going on.

Is there a place where I can see the "console.log" messages from a service worker?

Douglas Manley
  • 1,093
  • 13
  • 18
  • https://developers.google.com/web/tools/chrome-devtools/debug/remote-debugging/remote-debugging?hl=en – Alexander O'Mara Sep 06 '16 at 04:26
  • The main thing that I learned here is that, when my service worker wakes up and creates the notification, it shows up in the chrome://inspect/#devices list at the very bottom as "Worker pid:XXXXX". This does mean that I'll have to be very close to a computer when things get wonky, but it does give me a place to view the service worker's logs. – Douglas Manley Sep 06 '16 at 05:01
  • This is clearly not a duplicate of "How can I debug JavaScript on Android". This question is specifically about service workers. – jameshfisher Nov 10 '19 at 09:10

0 Answers0