VS Code - Android WebView Debugging
This extension uses the vscode-js-debug extension under the hood.
Using the debugger
When your launch config is set up, you can debug your project. Pick a launch config from the dropdown on the Debug pane in Code. Press the play button or F5 to start.
Right now the extension only supports attaching to an already running Google Chrome or WebView instance. This can be configured in the
.vscode/launch.json file in the root directory of your project.
In case you want to use the old Debugger for Chrome extension you can set
All configuration options of the
pwa-chrome: attach configuration of the vscode-js-debug extension are supported.
You can optionally specify a port to use for the debugging connection or let the extension automatically choose an unsued one.
It is possible to specify the device and/or the application to attach to. If multiple possible instances are found the extension will ask you to choose one.
"name": "Attach to Android WebView",
All contributed configuration fields
device: The serial of the device to use. It can be found using
application: The package name of the application to connect to. For example
connectTimeout: The time the extension will wait for the webview to be ready in milliseconds.
This extension contributes the following settings:
android-webview-debug.adbPath: Specifies the path to the ADB executable.
android-webview-debug.adbArgs: Specifies extra arguments for the ADB executable. For example
Failed to locate ADB executable.
The ADB executable was not found. Usually it should be on the PATH environment variable. You can also specify it manually using the
android-webview-debug.adbPath configuration parameter.
No WebViews found
Ensure that the device is connected and that the Android application is a debug build or WebView debugging is enabled. You can always find the available WebViews by visiting
chrome://inspect/#devices in Google Chrome.
No devices found
Ensure that USB Debugging is enabled on your Android device and that ADB can find it. You can find a list of connected devices using the command