I have an Android phone, and the goal is to connect the phone to a password protected wifi network.
Steps I know so far:
adb shell svc wifi enable
This is possible to achieve using
wpa_cli, command line interface of
# Enable WiFi adb root adb shell # Get to wpa_cli prompt wpa_cli -p /data/misc/wifi/sockets/ -i wlan0 # Add new WiFi network add_network set_network 0 auth_alg OPEN set_network 0 key_mgmt WPA-PSK set_network 0 ssid "network_name" set_network 0 proto RSN set_network 0 mode 0 set_network 0 psk "password" # Connect to it select_network 0 enable_network 0 reassociate # Check the status status
In the above list of commands,
add_command will output the index of the new network, which should be used for the subsequent commands. In this example, this index is