Newer Version Available

This content describes an older version of this product. View Latest

Debug in Android

  1. On your emulated Android device, open the Settings app.
  2. Enter About emulated device into the search bar, and tap the result titled About emulated device.
  3. Scroll to the bottom of the page and tap Build number seven times. The message “You are now a developer!” appears after the seventh tap, meaning that developer mode is enabled for the emulator.
  4. Launch Chrome on your desktop. In the location bar, enter chrome://inspect/#devices.
  5. Select Inspect for the WebView under the Remote Target emulator you’re using.
    A window appears containing your emulator with Chrome DevTools connected to it. You can use Chrome DevTools to inspect the LWC element, set breakpoints, and see the console output. As with iOS, you can use the standard web development techniques for working with HTML, CSS, and JavaScript to run, test, debug, and improve your LWC. Web browser debugger view, with console output on one side and page elements on the other

For additional information on the basics of debugging with Chrome Developer Tools, see Remote debugging WebViews (Google).

For a deeper dive on debugging JavaScript in an embedded WebView of an Android mobile app, see Debugging embedded JavaScript in an Android app using Chrome DevTools.