Hi, I need to find a way to use the dadb library to call commands directly. I've managed to do it by calling adb with wireless debugging via code below, but if I don't enable adb tcpip 5555 beforehand using my PC, I get a connection refused error.
AdbKeyPair keyPair = loadOrCreateKeyPair(appContext);
try (Dadb dadb = Dadb.Companion.create(host, port, keyPair)) {
AdbShellResponse response = dadb.shell(command);
String output = response.getAllOutput();
return output == null ? "" : output.trim();
}
So, is there a way I can enable adb tcpip 5555 without connecting to a PC? I know I can root my device and call the adb service, but I don't want to use that method.
Hi, I need to find a way to use the dadb library to call commands directly. I've managed to do it by calling adb with wireless debugging via code below, but if I don't enable adb tcpip 5555 beforehand using my PC, I get a connection refused error.
So, is there a way I can enable adb tcpip 5555 without connecting to a PC? I know I can root my device and call the adb service, but I don't want to use that method.