Soccertrash
Soccertrash

Reputation: 1901

Get configured wifis with ADB

Is there a way to get the configured WiFi-SSIDS from an Android (not rooted) device via ADB? This should be working independant from the WiFi on/off state.

Thank you

Upvotes: 5

Views: 21438

Answers (4)

sarah
sarah

Reputation: 15

adb pull does work on unrooted devices. u need to run the command as root first. try the following:

in the same command prompt box,

-type [adb root] to restart adb as root. click enter.

-Now type [adb shell], click enter. makes sure the prompt shows [root@[device]: ]

-At the # prompt type [cd /data/misc/wifi] click enter.

-Lastly type [cat wpa_supplicant.conf] click enter.

this should dump data of WiFi you've previously connected to on your phone, to your pc screen.

*type in without brackets []

these command works on my unrooted device after running into the “remote object does not exist” issue.

Upvotes: -3

Soccertrash
Soccertrash

Reputation: 1901

Finally found out that

adb shell dumpsys wifi | grep -i ssid

gives the configured wifis

Edit: Only if wifi is enabled

Upvotes: 6

Alex P.
Alex P.

Reputation: 31676

Not possible. WifiManager.getConfiguredNetworks() only works when WiFi is on.

Upvotes: 2

Nishant Pardamwar
Nishant Pardamwar

Reputation: 1485

generally all the configured WIFIs with their passwords are stored in wpa_supplicant.conf which saved in

/data/misc/wifi/wpa_supplicant.conf

but you cant access it unless you have root permission.

you can pull the file by this command

if using windows

adb pull /data/misc/wifi/wpa_supplicant.conf c:\

if using ubuntu

adb pull /data/misc/wifi/wpa_supplicant.conf ~/

Upvotes: 6

Related Questions