Skip to content

Curated collection of powerful Wi-Fi management commands that can be executed on an Android device from a Linux machine using ADB. ⭐️

License

Notifications You must be signed in to change notification settings

DouglasFreshHabian/AndroidWiFiCommands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

📳 Android WiFi Power Commands (ADB + Linux)

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.


⚠️ Requirements

  • Linux machine

  • Android device with:

    • Developer Options enabled
    • USB Debugging enabled
  • Android Debug Bridge (adb) installed

Install adb (Debian/Ubuntu):

sudo apt install adb

Verify connection:

adb devices

You should see your device listed.


📡 WiFi Command Walkthrough

All commands use:

adb shell cmd wifi <command>

1️⃣ Check WiFi Status

Check current WiFi state and connection info:

adb shell cmd wifi status

2️⃣ Enable / Disable WiFi

Enable WiFi:

adb shell cmd wifi set-wifi-enabled enabled

3️⃣ Get Country Code

Returns the regulatory country code currently applied:

adb shell cmd wifi get-country-code

4️⃣ Trigger a WiFi Scan

Force a scan:

adb shell cmd wifi start-scan

5️⃣ List Scan Results

View nearby networks from the last scan:

adb shell cmd wifi list-scan-results

6️⃣ Enable Scan Always Available

Allows scanning even when WiFi is turned off:

adb shell cmd wifi set-scan-always-available enabled

Verify:

adb shell cmd wifi status

7️⃣ List Saved Networks

Show saved network profiles:

adb shell cmd wifi list-networks

Example output:

0  MyNetwork
1  OfficeWiFi

8️⃣ Connect to a Network

Connect to a standard WPA2 network:

adb shell cmd wifi connect-network "LabSSID" wpa2 "Password123"

Connect to a hidden network:

adb shell cmd wifi connect-network "HiddenSSID" wpa2 "Password123"

Connect to a specific BSSID (MAC address):

adb shell cmd wifi connect-network "LabSSID" wpa2 "Password123" -b aa:bb:cc:dd:ee:ff

9️⃣ Forget a Saved Network

First list networks:

adb shell cmd wifi list-networks

Then forget by ID:

adb shell cmd wifi forget-network 0

🔟 Connected Score Manipulation

⚠️ Requires active WiFi connection.

Set connection score (influences system network ranking):

adb shell cmd wifi set-connected-score 10

Reset score:

adb shell cmd wifi reset-connected-score

1️⃣1️⃣ SoftAP (Hotspot) Feature Support

Check supported hotspot capabilities:

adb shell cmd wifi get-softap-supported-features

1️⃣2️⃣ Verbose Logging (Advanced Debugging)

Check if verbose logging is enabled:

adb shell cmd wifi is-verbose-logging

Enable verbose logging (level 1):

adb shell cmd wifi set-verbose-logging enabled -l 1

Disable verbose logging:

adb shell cmd wifi set-verbose-logging disabled -l 0

Verify:

adb shell cmd wifi is-verbose-logging

🔬 Example Workflow

Example 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 status

🛠 Troubleshooting

If commands fail:

  • Ensure device is authorized (adb devices)

  • Make sure WiFi is enabled

  • Some commands may require:

    • Root access
    • Specific Android versions
    • Active connection

📌 Notes

  • 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.

📜 License

For educational and research purposes only.


☕ Support This Project

If AndroidWiFiCommands™ helps you in your understanding & exploration of Android devices, consider supporting ongoing development:

Buy Me A Coffee

About

Curated collection of powerful Wi-Fi management commands that can be executed on an Android device from a Linux machine using ADB. ⭐️

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

 
 
 

Contributors