Get configured wifis with ADB

后端 未结 4 1073
孤城傲影
孤城傲影 2021-01-07 04:32

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 yo

相关标签:
4条回答
  • 2021-01-07 04:58

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

    0 讨论(0)
  • 2021-01-07 04:58

    Finally found out that

    adb shell dumpsys wifi | grep -i ssid
    

    gives the configured wifis

    Edit: Only if wifi is enabled

    0 讨论(0)
  • 2021-01-07 05:07

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

    0 讨论(0)
  • 2021-01-07 05:08

    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.

    0 讨论(0)
提交回复
热议问题