diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp --- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp +++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp @@ -141,7 +141,7 @@ if (const char *env_port = std::getenv("ANDROID_ADB_SERVER_PORT")) { port = env_port; } - std::string uri = "connect://localhost:" + port; + std::string uri = "connect://127.0.0.1:" + port; m_conn->Connect(uri.c_str(), &error); return error; diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp --- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp @@ -188,7 +188,7 @@ if (error.Success()) { m_port_forwards[pid] = local_port; std::ostringstream url_str; - url_str << "connect://localhost:" << local_port; + url_str << "connect://127.0.0.1:" << local_port; connect_url = url_str.str(); break; }