Skip to content Skip to sidebar Skip to footer

How To Enable Webkit's Remote Debugging/inspector Of Android App Using Webview?

I need to inspect javascript execution (webview widget) in an android application, while debugging; through SDK & usb cable and/or http/websockets; from destop computer (e.g.

Solution 1:

For android >= 4.4 (kitkat)

See Remote debugging on Android with Chrome

For android < 4.4 (Lower versions)

Use very good open source tool: weinre. See this video for help to use it. If you are familiar with grunt then you can use grunt-weinre

For quick view:

  1. install weinre using npm
  2. Do the configuration in your gruntfile.
  3. Run the weinre grunt task.
  4. Use this script to inject the weinre target code into your web page.
  1. Open http://localhost:8082 in your browser and you will find devices running above script. You can debug all this devices.

NOTE: if you want to debug webview/browser in your mobile device then you need to replace localhost with your machine's IP running weinre. And yes, all the devices should be on the same network.

Solution 2:

Solution 3:

You can do remote debugging targeting the Android Browser with the weinre project. Or use Chrome remote debugging with the Chrome for Android browser. As far as I know, you can't target a WebView directly, but targeting the Android Browser should get you close.

Solution 4:

It cannot be done, because the debugger backend code is not there. The source code you are referencing to is a copy of webkit source in android, but it is not compiled into android release bits.

Solution 5:

Pre KitKat jsHyBugger works well ( trial version and annual single user license €29 )

( I have no connection to the developers / have purchased a license )

Post a Comment for "How To Enable Webkit's Remote Debugging/inspector Of Android App Using Webview?"