Diagnosing and Fixing Android Wi‑Fi Issues with ADB

14 min read Step‑by‑step guide to capture, read and act on Android Wi‑Fi logs with ADB, helping you solve common connectivity issues without rooting the device. October 04, 2026 20:30 How to Diagnose and Fix Android Wi‑Fi Connectivity Problems Using ADB and Logcat

Why Wi‑Fi Problems Appear on Android

Even though Android’s Wi‑Fi stack is mature, a combination of firmware quirks, app interference, and mis‑configured network settings can cause symptoms such as:

  • Unable to connect to a known network
  • Frequent disconnections after a few minutes
  • Very slow web browsing while the signal looks strong
  • “Limited connectivity” or “No internet” messages
These issues are often invisible from the UI because Android only shows a generic error. The real cause lives in the system logs, which record every Wi‑Fi state transition, DHCP exchange, and driver warning. By pulling those logs with adb logcat, we can see exactly what the radio and network stack are complaining about and choose a targeted fix.

Before You Start

  • Computer with ADB installed – Follow any standard ADB setup guide if you don’t have it already.
  • USB cable – Use a data‑capable cable; charging‑only cables will not allow ADB communication.
  • Battery charge ≥ 40 % – Log capture can take several minutes; a low battery may cause the device to suspend Wi‑Fi mid‑test.
  • Wi‑Fi network details – SSID, password, and whether it uses WPA2‑PSK, WPA3, or an enterprise EAP method.
  • Backup of important data – Some fixes involve resetting network settings, which removes saved Wi‑Fi passwords.

Step 1 – Enable Developer Options and USB Debugging

  1. Open Settings → About phone.
  2. Tap Build number seven times. You’ll see a toast: “You are now a developer!”.
  3. Return to the main Settings page; a new entry Developer options appears.
  4. Enter Developer options and toggle USB debugging ON.
  5. If your device runs Android 12+ you may also see Wireless debugging. Enabling it is optional but useful for later Wi‑Fi‑only troubleshooting.

Enabling USB debugging authorises the computer to issue ADB commands. Without it the device will refuse any connection, and you’ll see “unauthorized” in the ADB output.

Step 2 – Verify ADB Connection

  1. Connect the phone to the computer via USB.
  2. Open a terminal (Command Prompt, PowerShell, or a Linux shell) and run:
  3. adb devices
  4. You should see a line with your device’s serial number followed by device. If it says unauthorized, check the phone for a dialog asking to allow USB debugging and tap Allow.

Successful verification means you can now issue any ADB command, including log extraction.

Step 3 – Capture a Focused Wi‑Fi Log

Capturing the entire system log is noisy. We’ll filter for the Wi‑Fi subsystem to keep the output manageable.

  1. Open a terminal and run the following command, which writes only Wi‑Fi‑related tags to wifi_log.txt:
  2. adb logcat -b all -v threadtime | grep -i "wifi" > wifi_log.txt
  3. Leave the terminal running. While it’s active, reproduce the problem on the phone (e.g., try to join the network, watch the disconnection, or load a webpage that stalls).
  4. After the issue has manifested, stop the log capture with Ctrl + C**.
  5. The file wifi_log.txt now resides in the current directory. Open it with any text editor.

Why we use -b all: Android stores logs in multiple buffers (main, system, radio). Wi‑Fi events are logged in the radio buffer, but some higher‑level events appear in system. Using -b all guarantees we don’t miss anything.

Step 4 – Understanding Common Log Patterns

Below is a short, annotated excerpt of what a typical Wi‑Fi failure looks like. Real logs are longer, but the same markers repeat.

04-12 14:23:01.123  1123  1123 I wifi    : WiFiStateMachine CMD_CONNECT_NETWORK: networkId=5
04-12 14:23:01.145  1123  1123 D wifi    : DhcpStateMachine CMD_START_DHCP: iface=wlan0
04-12 14:23:03.567  1123  1123 W wifi    : DhcpStateMachine: DHCP failed, error=2
04-12 14:23:03.569  1123  1123 E wifi    : NetworkAgent: Network validation failed (no internet)
04-12 14:23:04.001  1123  1123 I wifi    : SupplicantStateMachine CMD_DISCONNECT
04-12 14:23:04.010  1123  1123 I wifi    : SupplicantStateMachine EVENT_DISCONNECTED

Key tags to look for:

  • I wifi – Informational messages from the Wi‑Fi manager.
  • D wifi – Debug messages, often DHCP details.
  • W wifi – Warnings; a common sign of a problem.
  • E wifi – Errors that usually require action.

Notice the DHCP failed and Network validation failed lines. Those are the two most frequent culprits:

  • DHCP failed, error=2 – The device could not obtain an IP address from the router.
  • Network validation failed (no internet) – The router gave an IP, but the device could not reach Google’s connectivity check.

By identifying which line appears first, you can decide whether the problem is at the router‑DHCP level or at higher‑level DNS/Internet access.

Step 5 – Quick Fixes Based on Log Findings

Below we map the most common log signatures to concrete actions. Perform the actions in the order presented; many issues resolve after the first step.

5.1 – DHCP Failure (error=2 or error=3)

  • Action 1 – Forget and Re‑add the Network
    1. On the phone, go to Settings → Network & internet → Wi‑Fi.
    2. Tap the gear icon next to the problem SSID and choose Forget.
    3. Reconnect by selecting the SSID again and entering the password.

    Forgetting forces the device to request a fresh lease, clearing any stale DHCP cache.

  • Action 2 – Restart the Router

    Power‑cycle the router for 30 seconds. A reboot clears its DHCP table and often resolves address conflicts.

  • Action 3 – Assign a Static IP via ADB

    If the router’s DHCP server is unreliable, you can give the device a static IP using the hidden ip command. This method is advanced and should be used only when you control the network.

    # Replace 192.168.1.100/24 with an unused address in your subnet
    adb shell su -c "ifconfig wlan0 192.168.1.100 netmask 255.255.255.0 up"
    # Set the default gateway
    adb shell su -c "route add default gw 192.168.1.1 dev wlan0"

    Warning: Not all devices allow su without root. If the command fails, revert to DHCP.

5.2 – Network Validation Failed (No Internet)

  • Action 1 – Check DNS Settings
    1. Open Settings → Network & internet → Advanced → Private DNS.
    2. Set it to Off or configure a known provider (e.g., dns.google).

    Incorrect Private DNS can block the validation ping to connectivitycheck.gstatic.com.

  • Action 2 – Disable Wi‑Fi Optimizations

    Battery‑saving modes sometimes throttle Wi‑Fi. Disable them temporarily:

    1. Settings → Battery → Battery saver → Turn off (or set to “Never” for Wi‑Fi).
    2. Settings → Wi‑Fi → Advanced → Wi‑Fi optimization → Off (if present).
  • Action 3 – Reset Network Settings

    This clears all saved Wi‑Fi, Bluetooth, and VPN configurations, forcing a clean slate.

    adb shell am start -a android.settings.RESET_NETWORK_SETTINGS

    Confirm the dialog on the phone. After the reset, reconnect to the Wi‑Fi network.

5.3 – Repeated Supplicant State Changes (DISCONNECTED ↔ SCANNING)

  • Action – Update Wi‑Fi Driver via OTA

    Some devices ship with a buggy Wi‑Fi driver that is fixed in a later OTA (over‑the‑air) update. Check Settings → System → System update. If an update is available, install it and retest.

  • Action – Disable “Wi‑Fi Scanning” in Location Settings

    On Android 10+ the system may scan for Wi‑Fi networks even when Wi‑Fi is off, causing extra state churn.

    1. Settings → Location → Wi‑Fi scanning → Off.
    2. Settings → Location → Bluetooth scanning → Off (optional).

Step 6 – Advanced Log‑Based Diagnosis

If the quick fixes didn’t solve the problem, dive deeper into the log. Below is a table of frequent error strings and what they usually indicate.

Error StringTypical MeaningSuggested Action
WPA2-PSK handshake failedIncorrect password or router incompatibilityRe‑enter password, try WPA2‑AES only mode on router
SupplicantStateMachine EVENT_AUTH_FAILUREAuthentication failure (often enterprise EAP mis‑config)Check EAP settings, certificates, or switch to WPA2‑PSK for testing
WifiNetworkSuggestionManager: Suggestion rejectedThird‑party app suggestion blocked by policyRemove or update the app, or disable network suggestions
WifiMonitor: Network not foundRouter SSID not broadcasting or out of rangeEnsure SSID broadcast is enabled, move closer
WifiMonitor: DHCP failed, error=4IP conflict – another device already uses the offered addressAssign a static IP outside the DHCP pool or reboot router

Search the log for any of the strings above using grep. For example:

grep -i "handshake failed" wifi_log.txt

If you find a match, apply the corresponding action.

Step 7 – Verifying the Fix

After applying a fix, repeat the log capture (Step 3) to confirm the offending lines disappear.

  1. Reconnect to the Wi‑Fi network.
  2. Open a browser and load a page that previously stalled.
  3. Stop the log capture after a minute.
  4. Search the new wifi_log.txt for W or E tags related to Wi‑Fi.
  5. If none appear, the issue is resolved. If they persist, note the new error string and repeat Step 6.

Step 8 – Optional: Automating Log Capture for Future Issues

For power users who encounter intermittent Wi‑Fi glitches, you can create a tiny shell script that starts logging, waits a configurable period, and then saves the file with a timestamp.

# save as capture_wifi.sh and make executable (chmod +x)
#!/bin/bash
TS=$(date +%Y%m%d_%H%M%S)
FILE="wifi_${TS}.txt"
adb logcat -b all -v threadtime | grep -i "wifi" > "$FILE" &
PID=$!
# Capture for 60 seconds
echo "Capturing Wi‑Fi log for 60 seconds…"
sleep 60
kill $PID
echo "Log saved to $FILE"

Run it whenever you notice a glitch; the timestamped file helps you build a personal archive of Wi‑Fi behavior across different networks.

Troubleshooting Common Log‑Capture Problems

  • Log file is empty

    Make sure the device is not in Doze mode. Temporarily disable Doze by running adb shell dumpsys deviceidle disable. Also verify that the USB cable is not a charge‑only cable.

  • Permission denied when running su commands

    Most consumer devices do not grant root privileges to ADB. Stick to the non‑root methods (forget network, reset settings). If you own a rooted device, ensure the su binary is present and that you grant permission when prompted.

  • “device offline” after reconnecting

    Disconnect and reconnect the USB cable, then run adb kill-server && adb start-server. On some devices you must re‑enable USB debugging after a reboot.

When to Escalate to Manufacturer Support

If after exhausting the steps above the device still cannot maintain a Wi‑Fi connection on multiple routers, the problem is likely hardware‑related (e.g., a failing Wi‑Fi antenna) or a deep firmware bug. In that case:

  1. Gather the latest log file.
  2. Note the device model, Android version, and any custom ROM or carrier firmware.
  3. Contact the manufacturer’s support portal and attach the log. Mention the specific error strings you observed.

Providing a concise log excerpt often speeds up the troubleshooting process, because the support engineers can reproduce the exact failure path.

Summary

Android Wi‑Fi problems can be frustrating, but the system logs give us a transparent view of what’s going wrong. By enabling ADB, capturing a focused Wi‑Fi log, interpreting the most common error patterns, and applying the targeted fixes described above, you can resolve the majority of connectivity issues without rooting or flashing custom firmware. Keep the troubleshooting flow handy, and you’ll turn a vague “Can’t connect” message into a concrete, solvable problem.

User Comments (0)

Add Comment
We'll never share your email with anyone else.