Remote Debugging of Webviews

Please note, this section is related to remote debugging using the Chrome browser.

The Google Chrome Developer Docs have a handy tutorial on debugging webviews remotely. Alternatively, for the condensed version, you can continue reading.

The following steps are necessary in order to debug the webview:

  • Enable webview from within the application, by using the below snippet:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    WebView.setWebContentsDebuggingEnabled(true);
}
  • Open a debug enabled webview in devtools, using chrome://inspect.
  • Click “inspect” below the webview you wish to debug.

Please Note: In order to bypass the PlayCanvas login page, you need to run the following snippet in your browser console.

window.document.forms[0].getElementsByClassName('username_or_email').value = <playcanvas username>

window.document.forms[0].getElementsByClassName('password').value = <playcanvas password>

window.documents.forms[0].submit()

Remember to input your personal Username and Password values!