Debug Android WebView from PC via adb

I recently started developing Android. I am actually creating a web application that starts with Android WebView. So, I would like to know if there is a way to debug a web application (js, css, html) from a PC via ADB or something else. I took it apart and got options, but no one has an extensive debugging tool like firebug. Thus, any ideas will be highly appreciated. Thanks in advance.

+4
source share
1 answer

Starting with Android 4.2 (if I'm not mistaken in the version) you can:

  • enable development mode on your phone.
  • Connect it via USB cable to PC.
  • make sure "trust this computer" on your tablet / phone
  • go to chrome://inspect on your computer in Google Chrome, you will see your device and the pages open on it.
  • clicking on one of the links will call up the inspector for the corresponding page on the device, including the check item, console, network and everything else that the Chrome inspector has.

This is how I debug my application on a Nexus 7 tablet. If you have an older version of Android installed on your device, you can do a little without console.log and it is tedious to find them through adb logcat .

0
source

Source: https://habr.com/ru/post/1502373/