Connecting to WiFi using adb shell

前端 未结 6 782
Happy的楠姐
Happy的楠姐 2020-11-27 04:45

I have all the details to connect to a particular access point. I have to use that access point only, so all I require is the command to do it.

6条回答
  •  孤街浪徒
    2020-11-27 04:57

    I solve the problem by this: adb pull /data/misc/wifi/wpa_supplicant.conf ~/Desktop,and then edit the file, add network module, my whole conf file is:

    ##### wpa_supplicant configuration file template #####
    update_config=1
    ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi
    eapol_version=1
    ap_scan=1
    fast_reauth=1
    network={
        ssid="your ssid"
        psk="your pswd"
        key_mgmt=WPA-PSK
        priority=241
    }
    

    Then rm the origin file, add push it to /data/misc/wifi folder, reboot your device.Please note, different device has different content above the network line,don't modify that part.

提交回复
热议问题