diff --git a/renderdoc/core/remote_server.cpp b/renderdoc/core/remote_server.cpp index e13113284..b26e5314c 100644 --- a/renderdoc/core/remote_server.cpp +++ b/renderdoc/core/remote_server.cpp @@ -1187,6 +1187,13 @@ RENDERDOC_CreateRemoteServerConnection(const char *host, uint32_t port, RemoteSe if(host != NULL && host[0] != '\0') s = host; + if(!strncmp(host, "adb:", 4)) + { + s = "127.0.0.1"; + + // could parse out an (optional) device name from host+4 here. + } + if(port == 0) port = RENDERDOC_GetDefaultRemoteServerPort(); diff --git a/renderdoc/core/target_control.cpp b/renderdoc/core/target_control.cpp index 0eb7c9467..538e3f18d 100644 --- a/renderdoc/core/target_control.cpp +++ b/renderdoc/core/target_control.cpp @@ -705,12 +705,22 @@ extern "C" RENDERDOC_API TargetControl *RENDERDOC_CC RENDERDOC_CreateTargetContr if(host != NULL && host[0] != '\0') s = host; + bool android = false; + + if(!strncmp(host, "adb:", 4)) + { + android = true; + s = "127.0.0.1"; + + // could parse out an (optional) device name from host+4 here. + } + Network::Socket *sock = Network::CreateClientSocket(s.c_str(), ident & 0xffff, 750); if(sock == NULL) return NULL; - bool localhost = Network::GetIPOctet(sock->GetRemoteIP(), 0) == 127; + bool localhost = !android && (Network::GetIPOctet(sock->GetRemoteIP(), 0) == 127); TargetControl *remote = new TargetControl(sock, clientName, forceConnection != 0, localhost); diff --git a/renderdoc/replay/entry_points.cpp b/renderdoc/replay/entry_points.cpp index 89befa69a..6d47f9322 100644 --- a/renderdoc/replay/entry_points.cpp +++ b/renderdoc/replay/entry_points.cpp @@ -477,6 +477,13 @@ extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_EnumerateRemoteTargets( if(host != NULL && host[0] != '\0') s = host; + if(!strncmp(host, "adb:", 4)) + { + s = "127.0.0.1"; + + // could parse out an (optional) device name from host+4 here. + } + // initial case is we're called with 0, start with the first port. // otherwise we're called with the last successful ident, so increment // before continuing to enumerate.