How can I configure and enable/disable the WiFi Hotspot using the terminal without root? Also I want to kick a user from my hotspot using the terminal.

  • 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, 2019 at 5:56
  • @unforgettableid on device terminal
    – DanielSeow
    Dec 26, 2019 at 6:46
  • Why don't you want to just create a hotspot in the normal way, using the Android GUI? Dec 26, 2019 at 9:38

1 Answer 1


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.


  • How do you set ap band through these commands
    – Chemist
    Mar 13, 2023 at 14:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .