2

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.

Daniel Walker
  • 238
  • 3
  • 17
DanielSeow
  • 121
  • 1
  • 3

1 Answers1

3

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.


RELATED:

Irfan Latif
  • 20,353
  • 3
  • 70
  • 213