---
title: "Remote Debugging Mobile Web on Real Android and iOS Devices"
description: "Debug websites and WebViews on real phones: chrome://inspect and adb reverse on Android, Safari Web Inspector on iOS, inspectable WebViews and the bugs only real devices show."
url: https://sanderyaz.com/en/blog/mobile-web-remote-debugging/
author: Sander Yazıcıoğlu
date: 2026-12-06
updated: 2026-12-06
lang: en
tags: ["Mobile","Debugging","Android","iOS"]
---

# Remote Debugging Mobile Web on Real Android and iOS Devices

Working on LiveTesting meant living with real phones: the whole product is about getting a real device's screen and controls into a browser. The habit that stuck with me is that a phone-sized viewport in desktop DevTools is not a phone. The software keyboard, the collapsing address bar, the slow CPU and the WebView inside someone's app all behave differently. On the corporate and health-tourism sites I build, where many visitors arrive on phones, the bugs that hurt most only showed up on real devices. Here is how to get full DevTools on them.

## What device emulation can't show you

Desktop responsive mode changes the viewport size and user agent. It does not reproduce:

| Real-device behaviour | Typical bug |
| --- | --- |
| Software keyboard resizing the visual viewport | Fixed footer or chat button covers the input |
| Collapsing browser toolbars | `100vh` sections that are too tall |
| Real mobile CPU | Long tasks and poor INP that a laptop hides |
| Touch input and no hover | Menus that only open on `:hover` |
| In-app WebViews (Instagram, WhatsApp, your own app) | Missing APIs, different cookies, blocked popups |

That is why remote debugging belongs in the normal workflow, not only for emergencies.

## Android: chrome://inspect

1. On the phone, enable **Developer options** (tap the build number seven times) and turn on **USB debugging**.
2. Connect via USB and accept the RSA fingerprint prompt.
3. On the desktop, open `chrome://inspect/#devices` in Chrome. Every open tab in Chrome on the phone is listed with an **inspect** link.

You get the full DevTools: Elements, Console, Network, Performance, plus a live screencast of the device. Check the connection first if nothing appears:

```bash
adb devices
# List of devices attached
# R58M12ABCDE    device
```

If it says `unauthorized`, the fingerprint prompt wasn't accepted. More commands like this are in [ADB commands for testers](/en/blog/adb-commands-for-testers/).

## Testing your local dev server on the phone

You don't need to deploy or expose your laptop to the network. Map the phone's localhost to your machine:

```bash
adb reverse tcp:5173 tcp:5173
# now http://localhost:5173 on the phone hits your Vite server
adb reverse --list
adb reverse --remove-all
```

`chrome://inspect` has the same feature under **Port forwarding**. Using localhost on the phone has a bonus: it counts as a secure context, so service workers, `getUserMedia` and other HTTPS-only APIs work without certificates.

For cable-free work on Android 11+, use **Wireless debugging** and pair with `adb pair <ip>:<port>`, then `adb connect <ip>:<port>`.

## Android WebViews

Content inside an app's WebView shows up in `chrome://inspect` only if the app enables it. In your own app's debug builds:

```kotlin
if (BuildConfig.DEBUG) {
    WebView.setWebContentsDebuggingEnabled(true)
}
```

Keep it out of release builds; it lets anyone with USB access inspect your app's web content.

## iOS: Safari Web Inspector

1. On the iPhone: **Settings → Apps → Safari → Advanced → Web Inspector** on (older iOS versions have it under Settings → Safari).
2. On the Mac: Safari **Settings → Advanced → Show features for web developers**, which adds the **Develop** menu.
3. Connect the phone, trust the computer, then pick the device and the page from **Develop**.

For your own app's `WKWebView`, iOS 16.4 and later require opting in:

```swift
#if DEBUG
if #available(iOS 16.4, *) {
    webView.isInspectable = true
}
#endif
```

To reach a dev server from the iPhone, there's no `adb reverse`, so bind the dev server to your LAN address (`vite --host`) and open your machine's IP on the phone, or use a tunnel. Without a Mac you can't use Web Inspector; a real-device cloud with a remote inspector is the practical alternative. Signing and WebDriverAgent setup for automation is a separate story, covered in [Appium on real iOS devices](/en/blog/appium-ios-real-device-setup/).

## Fixing the classic real-device bugs

**Keyboard covers the input.** Listen to the visual viewport instead of the window:

```js
const vv = window.visualViewport;
vv?.addEventListener('resize', () => {
  document.documentElement.style.setProperty('--kb-offset', `${window.innerHeight - vv.height}px`);
});
```

Then use `bottom: var(--kb-offset, 0)` on fixed footers, and `scrollIntoView({ block: 'center' })` on focus for long forms.

**Full-height sections.** Replace `100vh` with dynamic viewport units: `min-height: 100dvh;`, keeping `100vh` as a fallback line above it for old browsers.

**Hover-only menus.** Guard hover styles with `@media (hover: hover)` and make every menu open on click or tap.

**Slow interactions.** Record a Performance profile on the device itself through the remote DevTools. Long tasks that take 40 ms on a laptop can take several times longer on a mid-range phone; that is the INP your users see.

## Make it repeatable

Remote debugging finds the bug; automation keeps it fixed. Once you know a scenario breaks on a real device, add it to your device test suite instead of relying on someone remembering to check. Which flows deserve that coverage is the subject of [mobile test automation strategy](/en/blog/mobile-test-automation-strategy/).

## Conclusion

Use `chrome://inspect` and `adb reverse` on Android, Safari's Develop menu on iOS, and enable inspectable WebViews in debug builds. Then look specifically for the bugs emulation hides: keyboard overlap, viewport height, hover-only UI and slow interactions on real CPUs. Ten minutes on a real phone before release catches problems no amount of resizing the desktop window will.

---

About the author: [Sander Yazıcıoğlu](https://sanderyaz.com/en/about/). Sander Yazıcıoğlu is a Senior Full-Stack Developer in Istanbul. At LiveTesting he builds the backend, frontend, realtime systems and Appium automation of a real-device testing platform; before that he built enterprise Angular apps at Testinium and Loadium.
