android adb turn on wifi via adb
This works really well for and is really simple
adb -s $PHONESERIAL shell "svc wifi enable"
WiFi can be enabled by altering the settings.db like so:
adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
update secure set value=1 where name='wifi_on';
You may need to reboot after altering this to get it to actually turn WiFi on.
This solution comes from a blog post that remarks it works for Android 4.0. I don't know if the earlier versions are the same.
Try out the following which did work for me.
Method 1:
- Turn on the device
- Plug in the USB cable
- You will get the screen for turn on USB storage.
- Pull down the notification drawer
- Turn on wifi/Data
Tested on AT&T Fusion working fine.
Method 2:
Use the method given by shkschneider
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
adb shell input keyevent 20 & adb shell input keyevent 23
This works only if you have USB debugging turned on. If you do not have USB debugging turned on under Development do the following.
- Turn off the device.
- Boot into recovery mode (Power button + Volume up)
- Plug the device into computer.
- Use the ADB tool to execute the same commands given by shkschneider
Tested on AT&T fusion working fine.
You can turn on wifi : - connect usb on pc; - will show alert dialog "connect UMS mode or KIES" - do not click, do not cancel - pull notification bar and turn on wifi.