Back to All Articles
Mobile Testing

Wi-Fi & Network Testing for Mobile Devices

Honnesh Muppala May 5, 2026 8 min read

Overview

Network quality is one of the most critical and variable factors in mobile device testing. An application that works perfectly on a fast office Wi-Fi connection may fail completely in the field — on a weak signal, a local-only network, or an intentionally degraded connection. Testing across all three connection types is essential for any mobile product that relies on network connectivity.

From Experience: At Viasat, Wi-Fi and network testing was a core part of our IoT device validation. Devices had to maintain stable connections across Good, Local, and Bad network conditions — and the behaviour of the application under each had to be precisely characterised. The snippet intervals and unified error codes in this post are based on real test frameworks used in that environment.

The Three Wi-Fi Connection Types

For mobile and IoT device testing, Wi-Fi connections are classified into three types based on stability, latency, and internet access. Each type produces different application behaviour and is set up differently in a test environment.

Wi-Fi Connection Types — Quality Spectrum
Good Connection
Router → Ethernet (LAN)
Full internet access
No packet loss
Snippet every 300 sec / 5 min
Local Connection
Router only (no cable)
LAN access only
No internet access
Snippet every 100 sec
Bad Connection
Router 1 → Router 2 (blocked IP)
Unstable, high latency
Intermittent access
Snippet every 180 sec / 3 min

Good Connection

A good Wi-Fi connection represents a stable, reliable wireless connection between the device and a Wi-Fi network with full internet access. This is the baseline test environment — all features should work correctly here.

# Verify connectivity on a Good Connection
adb shell ping 8.8.8.8        # Google DNS — checks internet reachability
adb shell ping google.com     # Checks DNS resolution + internet

8.8.8.8 is Google's public DNS server. A successful ping confirms the device can reach the internet through the router.

Local Connection

A local Wi-Fi connection means the device is connected to a router that has no internet access — the router is powered on but its WAN port is unplugged. The device can communicate with other devices on the local network (LAN) but cannot reach the internet.

# Test connectivity on a Local Connection
adb shell ping 192.168.1.1    # Should succeed — router is reachable
adb shell ping 8.8.8.8        # Should fail — no internet

Bad Connection

A bad Wi-Fi connection simulates an unstable, unreliable network — high latency, packet loss, intermittent dropouts. This is the hardest environment to test in and reveals resilience issues that never appear on a good connection.

Setup Guide — Creating Each Connection Type in the Lab

Connection TypeSetup Instructions
Good Connection Connect the router to the internet via an Ethernet cable plugged into the router's LAN port. Device connects to the router's Wi-Fi SSID. The Ethernet provides full internet access.
Local Connection Turn the router on but leave the Ethernet cable disconnected (no internet feed). Device connects to the router's Wi-Fi SSID. Wi-Fi connection succeeds but internet is unreachable.
Bad Connection Use two routers (Router 1 and Router 2):
1. Connect Router 1 and Router 2 via Ethernet (Router 1 WAN → Router 2 WAN)
2. Enter Router 2's IP address into Router 1's DNS server settings
3. Block Router 2's IP address in Router 1's firewall rules
4. Device connects to Router 1's Wi-Fi
The DNS block creates an unstable, degraded connection — the device is connected but internet access is intermittent and unreliable

Unified Error Codes

Unified error codes are standardised connectivity status codes that appear in device logs. They indicate what the device is experiencing at a network level — each code maps to a specific connection event or failure reason.

# Command to read unified error codes from logcat
adb shell logcat -v time -b all | grep -i unified
Metadata / Reason CodeMeaningWhat to Check
Reason 1Connecting — device is attempting to establish a connectionNormal state during initial handshake; should resolve to Reason 7 quickly
Reason 2Bad password — authentication failed due to wrong Wi-Fi credentialsVerify the password entered is correct; check if the SSID requires a specific auth method
Reason 3Short disconnection — lost connection for approximately 10 minutesCheck for interference, signal strength, or brief AP outage; auto-reconnect should trigger
Reason 4Long disconnection — connection lost for more than 1 hourInvestigate sustained signal loss, DHCP lease expiry, or device power management cutting the radio
Reason 5Bad connection — unstable, degraded connection (high packet loss / latency)Check signal quality, interference sources; matches Bad Connection test environment
Reason 6Very long disconnection — connection lost for more than 6 hoursCritical issue; investigate persistent network outage, device restart, or hardware failure
Reason 7Good connection — stable, reliable connection established successfullyExpected steady state; snippet interval 300 seconds; no action required
Unified Error Code Flow — Device Connectivity Journey
R1
Connecting
R2
Bad Password
or
R7
Good
→ if drops →
R3
< 10 min
R4
> 1 hr
R6
> 6 hr

DFS vs Non-DFS Channels

Wi-Fi operates on different frequency bands, each subdivided into channels. Understanding DFS (Dynamic Frequency Selection) is critical for mobile device testing — especially on devices that operate in the 5 GHz band.

CategoryFrequency BandNumber of ChannelsCharacteristics
Non-DFS 2.4 GHz 9 channels Greater range; more interference (microwaves, Bluetooth, neighbours); lower throughput; simpler to test — always available
DFS 5 GHz 16 channels Less interference; higher throughput; DFS channels require radar detection — the device/AP must perform a 60-second CAC (Channel Availability Check) before use; some channels may be unavailable depending on the country's regulatory domain
Why DFS testing matters: DFS channels are shared with radar systems (aviation, weather). If a device detects radar on a DFS channel, it must immediately switch channels. This is a real hardware compliance requirement. Testing that the device correctly performs CAC and handles radar events is mandatory for Wi-Fi certification in many markets.

Logcat Commands for Wi-Fi Diagnostics

The most powerful tool for Wi-Fi debugging on Android is logcat filtering. These commands extract Wi-Fi and connectivity-specific logs from the device in real time:

# Monitor all Wi-Fi diagnostic logs
adb shell logcat -v time -b all | grep -i wifidiags

# Monitor unified connectivity error codes
adb shell logcat -v time -b all | grep -i unified

# Monitor build and system info in logs
adb shell logcat -v time -b all | grep -i build

# Save full logcat to file for offline analysis
adb logcat -v time -b all > wifi_test_log.txt

Understanding Logcat Output

A typical Wi-Fi diagnostics log line looks like:

04-23 10:35:42.881 W WifiStateMachine: Unified reason code: 7 (GOOD_CONNECTION)
04-23 10:35:42.882 D WifiDiags: Snippet generated. Interval: 300s

The timestamp, log level (W = Warning, D = Debug, E = Error, I = Info), tag, and message help you trace exactly what the Wi-Fi stack was doing at any moment.

ADB Network Commands Reference

CommandPurpose
adb shell ping 8.8.8.8Test internet reachability via Google DNS — confirms routing and internet access
adb shell ping google.comTest DNS resolution + internet — confirms DNS is working AND internet is reachable
adb shell svc wifi enableEnable Wi-Fi on the device via ADB
adb shell svc wifi disableDisable Wi-Fi — simulates Wi-Fi off scenario for interruption testing
adb shell wpa_cliConnect to or manage wireless networks; access wpa_supplicant interface
adb shell settings list globalList all global device settings — includes Wi-Fi and mobile data state
adb shell settings get global mobile_dataCheck if mobile data (cellular) is enabled (1) or disabled (0)
adb shell svc bluetooth enable/disableEnable or disable Bluetooth — useful for interference testing with 2.4 GHz Wi-Fi

Network Testing Checklist for Mobile Apps

Before releasing a mobile app to production, every item on this checklist should be verified. Network-related defects are among the hardest to catch post-release because they depend on real-world conditions — variable signal strength, carrier throttling, and unexpected handoffs — that are difficult to reproduce in the field. Running this checklist in a controlled lab environment before every release prevents a large category of customer-facing bugs.

References


Back to Blog
From Experience — Viasat: Working with ARINC 429 data buses and IFC hardware at Viasat, Wireshark became an essential daily tool. During a Boeing integration test, we observed unexpected burst rate timing that didn't match the Interface Control Document. Capturing ARINC 429 frames in Wireshark and comparing against the ICD revealed a 12ms timing offset — within tolerance on its own, but enough to cause cumulative drift on long-haul flights. That finding prevented an on-wing integration failure. Linux CLI diagnostics alongside Wireshark are indispensable for this level of root cause analysis.