How to Debug Android Chrome Browser Logs from a Windows Laptop
Testing a website on a real Android device is often necessary when an issue cannot be reproduced in desktop Chrome or device emulation. Chrome's remote debugging support lets you connect an Android phone to a Windows laptop and inspect the mobile Chrome tab using desktop Chrome DevTools. You can view: JavaScript console logs and errors Network requests and API responses Request and response headers HTML and CSS Cookies and browser storage JavaScript sources and breakpoints This guide starts with the normal setup flow. After that, it covers a common problem where Chrome reports Pending authentication and ADB reports the device as unauthorized. Part 1: Normal Setup Enable Developer Options on Android The exact menu path varies by manufacturer. On a Google Pixel: Settings → About phone → Build number Tap Build number seven times. Enter your phone PIN if prompted. Android should confirm that Developer Options have been enabled. On other Android devices, search Settings for Build number if you cannot find it. Enable USB Debugging On a Pixel, go to: Settings → System → Developer options Find USB debugging and turn it on. Confirm the warning when Android asks. Connect the Android Phone to Windows Connect the phone to your Windows laptop using a USB cable that supports data transfer, not just charging. Keep the phone unlocked. If Windows displays a message such as: > Choose what to do with this device you can close it. That is a Windows AutoPlay notification and is not the USB debugging authorization prompt. On the phone, if necessary, open the USB notification and select: File transfer / Android Auto Authorize USB Debugging After connecting the phone, Android should display: > Allow USB debugging? It will also show the computer's RSA key fingerprint. Select: Always allow from this computer and tap Allow. Open the Website on Android Chrome On your Android phone: Open Chrome. Navigate to the website you want to test. Leave the Chrome tab open. Open Chrome Remote Debugging on Windows On your Windows laptop, open Chrome and navigate to: chrome://inspect/#devices Make sure Discover USB devices is checked. Your Android device should appear on the page. Under the device, Chrome should display the Chrome tabs currently open on the phone. Find the website you want to debug and click inspect. Inspect the Mobile Browser Chrome DevTools opens on your laptop, but it is connected to the webpage running on your Android phone. Use Console to inspect: console.log() output JavaScript errors warnings uncaught exceptions Use Network to inspect: API requests HTTP status codes request payloads response bodies request and response headers request timing For example, if a login works on desktop but fails on Android: Open the Network tab. Perform the login on the Android phone. Find the login/API request. Inspect its Payload, Headers, and Response. This gives you the actual browser behavior from the physical Android device. --- Part 2: Troubleshooting Pending authentication / unauthorized Sometimes chrome://inspect/#devices detects the phone but displays something similar to: Device information is stale. Offline #DEVICE_SERIAL Pending authentication: please accept debugging session on the device. The phone may even report that USB debugging is connected. This means Windows can detect the Android device, but the ADB authorization handshake has not completed. Install Android Platform Tools Download SDK Platform-Tools for Windows from Google's Android developer website: https://developer.android.com/tools/releases/platform-tools Extract the downloaded ZIP file. Inside the extracted platform-tools directory, you should see files including: adb.exe fastboot.exe Open Command Prompt in platform-tools Open the platform-tools directory in Windows File Explorer. Click the File Explorer address bar, type: cmd and press Enter. Command Prompt will open directly in that directory. For example: C:\Users\YourName\Downloads\platform-tools> This lets you run ADB without adding it to the Windows PATH. Check the ADB Connection Run: adb devices If authorization has not completed, you may see: List of devices attached DEVICE_SERIAL unauthorized The important part is: unauthorized Reset USB Debugging Authorization On the Android phone, go to: Settings → System → Developer options Tap: Revoke USB debugging authorizations Confirm the action. Then turn USB debugging off. Restart the ADB Server On Windows, run: adb kill-server Disconnect the USB cable from the phone. Turn USB debugging back on. Reconnect the USB cable and keep the phone unlocked. Then run: adb start-server adb devices Starting ADB may display: * daemon not running; starting now at tcp:5037 * daemon started successfully Accept the Authorization Prompt Watch the Android phone. You should now receive: > Allow USB debugging? Select: Always allow from this computer and tap Allow. Verify That the Device Is Authorized Run again: adb devices Before authorization, the output looks like: List of devices attached DEVICE_SERIAL unauthorized After successful authorization, it should look like: List of devices attached DEVICE_SERIAL device That change from unauthorized to device confirms that ADB authorization succeeded. Return to Chrome Remote Debugging On the Windows laptop, refresh: chrome://inspect/#devices The Pending authentication message should disappear. Open Chrome on the Android phone and navigate to the website you want to test. The mobile Chrome tab should now appear under the device in chrome://inspect. Click inspect and use Chrome DevTools normally. Quick Troubleshooting Checklist If your Android Chrome tab does not appear: Make sure Developer options are enabled. Make sure USB debugging is enabled. Keep the phone unlocked. Use a USB cable that supports data transfer. Try File transfer / Android Auto as the USB mode. Check Discover USB devices in chrome://inspect/#devices. Run adb devices. If it says unauthorized, revoke USB debugging authorizations and restart ADB. Accept Allow USB debugging? on the phone. Verify that adb devices reports the phone as device. Final Result Once everything is working, the flow is: Android Chrome ↓ USB debugging / ADB ↓ Windows laptop ↓ chrome://inspect/#devices ↓ Chrome DevTools ↓ Console / Network / Elements / Application / Sources This setup is especially useful for bugs that occur only on physical Android devices, mobile authentication problems, API failures, responsive UI issues, and browser-specific JavaScript errors.
This is a summary aggregated from Dev.to. Read the complete article on the original site:
Read full article at Dev.to