Debugging Overview
Last updated
Last updated
By default, WebView debugging is enabled on all Wisej.NET Hybrid Debug builds and disabled on Release builds.
You can manually override the setting in the Hybrid Client Startup.cs file:
To debug an Android WebView using Chrome's developer tools, follow these steps:
Enable Developer Options on Your Android Device: On your Android device, go to "Settings" > "About Phone" and tap on the "Build Number" multiple times until you see a message confirming that Developer Options are enabled.
Enable USB Debugging: In the "Developer Options" settings, enable "USB Debugging." This allows your device to communicate with your development machine.
Connect Your Device to Your Computer: Connect your Android device to your computer using a USB cable.
Open Chrome on Your Computer: Launch the Google Chrome browser on your development machine.
Access Chrome DevTools: In Chrome, open a new tab and type "chrome://inspect" in the address bar. This will open the "Chrome Inspect Devices" page.
Discover Your Device: Under the "Devices" section, you should see your connected Android device listed. Click on it to open the DevTools for your device.
Inspect the WebView: In the DevTools window, you can now see the WebView content running on your Android device. You can inspect HTML elements, check the console for JavaScript errors, monitor network requests, and use the various debugging features offered by DevTools.
To debug an iOS WebView using Safari's developer tools, here's a step-by-step guide:
Enable Developer Mode on Your iOS Device: On your iOS device, go to "Settings" > "Developer" and enable "Web Inspector" or "Remote Web Inspector," depending on your iOS version.
Connect Your iOS Device to Your Mac: Connect your iOS device to your Mac using a USB cable or make sure both devices are on the same Wi-Fi network.
Open Safari on Your Mac: Launch the Safari browser on your Mac.
Enable Developer Menu in Safari: In Safari, open the "Safari" menu and go to "Preferences." In the "Advanced" tab, check the box that says "Show Develop menu in menu bar."
Access Safari's Web Inspector: On your iOS device, open the app containing the WebView you want to debug. Then, on your Mac, go to the "Develop" menu in Safari's menu bar. Your iOS device should appear in the dropdown list. Hover over your device's name, and you will see a list of open web pages in the app.
Select the WebView to Debug: Click on the WebView you want to debug in the list of open web pages. This will open Safari's Web Inspector, allowing you to inspect and debug the WebView content.
Inspect and Debug: Within Safari's Web Inspector, you can inspect HTML elements, check the console for JavaScript errors, analyze network requests, and use various debugging features. You can set breakpoints, step through JavaScript code, and modify the DOM in real-time to diagnose and fix issues in your WebView content.
Press F12