MuntashirAkon/AppManager · error · InterruptedException

Timed out while trying to find a valid host address and port

Error message

Timed out while trying to find a valid host address and port

What it means

Timeout guard in getLatestAdbDaemon(): the CountDownLatch waiting on mDNS discovery (TCP-connect and, on P+, TLS-connect services) expired before any service resolved a host address and port, or the resolved values were null. Wireless debugging may be off, the device on a different subnet, or mDNS packets blocked — no valid endpoint was found in time.

Solutions

  1. Increase the discovery timeout and retry
  2. Have the user toggle Wireless debugging off/on to re-announce mDNS services
  3. Ensure multicast/mDNS traffic is allowed on the network
  4. Fall back to manual entry of the pairing host and port
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at app/src/main/java/io/github/muntashirakon/AppManager/adb/AdbUtils.java:88 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/7a2db0650c9dcb9d. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/adb/AdbUtils.java:88

                atomicPort.set(port);
            }
            resolveHostAndPort.countDown();
        });
        AdbMdns adbMdnsTls = null;
        try {
            adbMdnsTcp.start();
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
                adbMdnsTls = new AdbMdns(context, AdbMdns.SERVICE_TYPE_TLS_CONNECT, (hostAddress, port) -> {
                    if (hostAddress != null) {
                        atomicHostAddress.set(hostAddress.getHostAddress());
                        atomicPort.set(port);
                    }
                    resolveHostAndPort.countDown();
                });
                adbMdnsTls.start();
            }
            if (!resolveHostAndPort.await(timeout, unit)) {
                throw new InterruptedException("Timed out while trying to find a valid host address and port");
            }
        } catch (RuntimeException e) {
            throw new IOException("Could not start ADB service discovery", e);
        } finally {
            stopDiscovery(adbMdnsTcp);
            stopDiscovery(adbMdnsTls);
        }

        String host = atomicHostAddress.get();
        int port = atomicPort.get();
        if (host == null || port == -1) {
            throw new IOException("Could not find any valid host address or port");
        }
        return new Pair<>(host, port);
    }

    private static void stopDiscovery(AdbMdns adbMdns) {
        if (adbMdns == null) {

View on GitHub (pinned to 0152f468fc)