How to enable Web Inspector in Safari and Chrome
This tutorial provides a detailed guide on enabling remote debugging for Chrome and Safari on both iPhone and Android devices. It covers Web Inspector settings, USB debugging activation, and complete setup steps to help you easily solve mobile web debugging challenges.
1. Enabling Chrome remote debugging on iPhone
Section titled “1. Enabling Chrome remote debugging on iPhone”- Open the Chrome browser, tap the bottom menu bar
- Go to Settings → Content Settings
- Turn on the Web Inspector switch
✅ Ready to use WebDebugX for debugging.
2. Enabling Safari debugging on iPhone
Section titled “2. Enabling Safari debugging on iPhone”- Go to Settings → search for “Safari”
- Scroll down to the Advanced option
- Enable the Web Inspector function
3. Enabling Chrome debugging on Android
Section titled “3. Enabling Chrome debugging on Android”- Settings → About Phone → tap Build Number 7 times to enable Developer Mode
- Go back and search for Developer Options
- Enable the USB Debugging function
⚠️ Note: the path may vary by device brand.
4. Enabling Web Inspector for your own apps
Section titled “4. Enabling Web Inspector for your own apps”Objective-C apps (WebKit)
Section titled “Objective-C apps (WebKit)”if (@available(iOS 14.0, *)) { webView.inspectable = YES;}Swift apps (WebKit)
Section titled “Swift apps (WebKit)”if #available(iOS 14.0, *) { webView.isInspectable = true}Java apps (WebView)
Section titled “Java apps (WebView)”// Enable debugging in Application or Main Activityif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { WebView.setWebContentsDebuggingEnabled(true);}Kotlin apps (WebView)
Section titled “Kotlin apps (WebView)”// Application-level debugging enableif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { WebView.setWebContentsDebuggingEnabled(true)}5. Running Chrome in debug mode (macOS / Windows)
Section titled “5. Running Chrome in debug mode (macOS / Windows)”Launch Chrome via the command line with parameters:
chrome.exe --remote-debugging-port=9222 --user-data-dir=chromedatadir⚠️ Note:
- Use a different
--user-data-dirvalue for each Chrome instance --remote-debugging-portvalues must differ too, or the ports will conflict