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.
Asked
Active
Viewed 4,038 times
2
Daniel Walker
- 238
- 3
- 17
DanielSeow
- 121
- 1
- 3
1 Answers
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
adband a USB cable? – unforgettableidSupportsMonica Dec 26 '19 at 05:56