This repository focuses on interacting directly with Android’s built-in Wi-Fi service via:
adb shell cmd wifi
It includes commands for:
- Inspecting Wi-Fi status and configuration
- Triggering scans and listing networks
- Connecting to open, WPA2, and hidden networks
- Managing saved networks
- Adjusting connection scoring
- Enabling verbose logging for debugging
This project is intended for educational, research, and lab use — ideal for developers, security researchers, and anyone interested in understanding how Android’s Wi-Fi stack works under the hood.
-
Linux machine
-
Android device with:
- Developer Options enabled
- USB Debugging enabled
-
Android Debug Bridge (
adb) installed
Install adb (Debian/Ubuntu):
sudo apt install adbVerify connection:
adb devicesYou should see your device listed.
All commands use:
adb shell cmd wifi <command>Check current WiFi state and connection info:
adb shell cmd wifi statusEnable WiFi:
adb shell cmd wifi set-wifi-enabled enabledReturns the regulatory country code currently applied:
adb shell cmd wifi get-country-codeForce a scan:
adb shell cmd wifi start-scanView nearby networks from the last scan:
adb shell cmd wifi list-scan-resultsAllows scanning even when WiFi is turned off:
adb shell cmd wifi set-scan-always-available enabledVerify:
adb shell cmd wifi statusShow saved network profiles:
adb shell cmd wifi list-networksExample output:
0 MyNetwork
1 OfficeWiFi
adb shell cmd wifi connect-network "LabSSID" wpa2 "Password123"Connect to a hidden network:
adb shell cmd wifi connect-network "HiddenSSID" wpa2 "Password123"adb shell cmd wifi connect-network "LabSSID" wpa2 "Password123" -b aa:bb:cc:dd:ee:ffFirst list networks:
adb shell cmd wifi list-networksThen forget by ID:
adb shell cmd wifi forget-network 0Set connection score (influences system network ranking):
adb shell cmd wifi set-connected-score 10Reset score:
adb shell cmd wifi reset-connected-scoreCheck supported hotspot capabilities:
adb shell cmd wifi get-softap-supported-featuresCheck if verbose logging is enabled:
adb shell cmd wifi is-verbose-loggingEnable verbose logging (level 1):
adb shell cmd wifi set-verbose-logging enabled -l 1Disable verbose logging:
adb shell cmd wifi set-verbose-logging disabled -l 0Verify:
adb shell cmd wifi is-verbose-loggingExample full workflow:
adb shell cmd wifi set-wifi-enabled enabled
adb shell cmd wifi start-scan
adb shell cmd wifi list-scan-results
adb shell cmd wifi connect-network "LabSSID" wpa2 "Password123"
adb shell cmd wifi statusIf commands fail:
-
Ensure device is authorized (
adb devices) -
Make sure WiFi is enabled
-
Some commands may require:
- Root access
- Specific Android versions
- Active connection
- These commands interact directly with Android's WiFi service.
- Behavior may vary depending on Android version and OEM modifications.
- Use responsibly and only on devices you own or have permission to test.
For educational and research purposes only.
If AndroidWiFiCommands™ helps you in your understanding & exploration of Android devices, consider supporting ongoing development:
