0

I have a non rooted Samsung device , i want to enable/disable wi-fi settings for my usages via adb.To open wifi for non rooted device via adb i ran below command

adb  -s 4d0075754fdb41cd shell  am start -n com.android.settings/.wifi.WifiSettings

By default the wifi is coming as diabled , i want to enable/disable it

I tried with Keyevent , however this did not helped much

adb shell input keyevent 22

The wi-fi slider looks like below , i tried with all available key_code . Can anyone point me a way to get the correct keycode here!!

wifi settings

renuka
  • 160
  • 1
  • 2
  • 15

2 Answers2

0

You can try adb -s $PHONESERIAL shell "svc wifi enable" if you just want to turn on the wifi with adb.

Was already answered here : android adb turn on wifi via adb

Chuk Ultima
  • 987
  • 1
  • 11
  • 21
0

You placed appium tag, so if you using appium, try running:

adb -s $device_id shell am broadcast -a io.appium.settings.wifi --es setstatus enable
adb -s $device_id shell am broadcast -a io.appium.settings.wifi --es setstatus disable
tcardoso
  • 668
  • 3
  • 8
  • 20