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
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 tap
s and keyevent
s using adb shell input
command, though it's not a commandline solution in true sense.
RELATED:
adb
and a USB cable? – unforgettableidSupportsMonica Dec 26 '19 at 5:56