Get configured wifis with ADB

2019-02-20 04:52发布

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

标签: android adb
4条回答
在下西门庆
2楼-- · 2019-02-20 05:17

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 ~/

查看更多
可以哭但决不认输i
3楼-- · 2019-02-20 05:18

Finally found out that

adb shell dumpsys wifi | grep -i ssid

gives the configured wifis

Edit: Only if wifi is enabled

查看更多
太酷不给撩
4楼-- · 2019-02-20 05:28

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.

查看更多
萌系小妹纸
5楼-- · 2019-02-20 05:35

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

查看更多
登录 后发表回答