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:
adb logcat, we can see exactly what the radio and network stack are complaining about and choose a targeted fix.
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.
adb devices
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.
Capturing the entire system log is noisy. We’ll filter for the Wi‑Fi subsystem to keep the output manageable.
wifi_log.txt:adb logcat -b all -v threadtime | grep -i "wifi" > wifi_log.txt
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.
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:
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.
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.
Forgetting forces the device to request a fresh lease, clearing any stale DHCP cache.
Power‑cycle the router for 30 seconds. A reboot clears its DHCP table and often resolves address conflicts.
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.
dns.google).Incorrect Private DNS can block the validation ping to connectivitycheck.gstatic.com.
Battery‑saving modes sometimes throttle Wi‑Fi. Disable them temporarily:
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.
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.
On Android 10+ the system may scan for Wi‑Fi networks even when Wi‑Fi is off, causing extra state churn.
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 String | Typical Meaning | Suggested Action |
|---|---|---|
WPA2-PSK handshake failed | Incorrect password or router incompatibility | Re‑enter password, try WPA2‑AES only mode on router |
SupplicantStateMachine EVENT_AUTH_FAILURE | Authentication failure (often enterprise EAP mis‑config) | Check EAP settings, certificates, or switch to WPA2‑PSK for testing |
WifiNetworkSuggestionManager: Suggestion rejected | Third‑party app suggestion blocked by policy | Remove or update the app, or disable network suggestions |
WifiMonitor: Network not found | Router SSID not broadcasting or out of range | Ensure SSID broadcast is enabled, move closer |
WifiMonitor: DHCP failed, error=4 | IP conflict – another device already uses the offered address | Assign 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.
After applying a fix, repeat the log capture (Step 3) to confirm the offending lines disappear.
wifi_log.txt for W or E tags related to Wi‑Fi.
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.
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.
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.
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.
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:
Providing a concise log excerpt often speeds up the troubleshooting process, because the support engineers can reproduce the exact failure path.
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.









