I want to start and stop adb wireless from an app using a rooted phone. I managed to start adb wireless daemon with these commands:
String cmds[] = {
"setprop service.adb.tcp.port 5555",
"stop adbd",
"start adbd"
};
Shell.su(cmds).exec();
But
String cmds[] = {
"stop adbd"
};
Shell.su(cmds).exec();
or
String cmds[] = {
"setprop service.adb.tcp.port 5555",
"stop adbd"
};
Shell.su(cmds).exec();
does not work to stop adb. At least it stops but I can't start it again with
setprop service.adb.tcp.port 5555
stop adbd
start adbd
How should I stop adb wireless properly from a rooted phone?