How can i configure and enable/disable the WiFi Hotspot by using terminal command without ROOT? Also I want to kick user from my hotspot using terminal command

  • Hi and welcome! Why do you want to do this using the terminal? Also, are you using an on-device terminal emulator, or a remote shell using adb and a USB cable? Dec 26 '19 at 5:56
  • @unforgettableid on device terminal
    – DanielSeow
    Dec 26 '19 at 6:46
  • 1
    @beeshyams sorry I guess my line wasn't stable just now causing it incomplete
    – DanielSeow
    Dec 26 '19 at 6:47
  • Why don't you want to just create a hotspot in the normal way, using the Android GUI? Dec 26 '19 at 9:38

Setting and enabling hotspot (software access point) is possible by calling methods setWifiApConfiguration and startSoftAp of wifi service. But at least since Android 8, the former requires permission OVERRIDE_WIFI_CONFIG while the latter requires NETWORK_STACK. Both permissions have Protection Level signature, not to be used by third party apps. Neither adb shell has any of the both permissions. So it's not possible without root access.

A workaround is to simulate taps and keyevents using adb shell input command, though it's not a commandline solution in true sense.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.