Skip to content

Can I call adb tcpip 5555 by itself #92

@vanhcm20

Description

@vanhcm20

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions