[PATCH] D66689: [Platform/Android] Read the adb server from an env variable if set

Nathan Lanza via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 13:14:57 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL370106: [Platform/Android] Read the adb server from an env variable if set (authored by lanza, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66689/new/

https://reviews.llvm.org/D66689

Files:
  lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp


Index: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
===================================================================
--- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
+++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
@@ -137,7 +137,12 @@
 Status AdbClient::Connect() {
   Status error;
   m_conn.reset(new ConnectionFileDescriptor);
-  m_conn->Connect("connect://localhost:5037", &error);
+  std::string port = "5037";
+  if (const char *env_port = std::getenv("ANDROID_ADB_SERVER_PORT")) {
+    port = env_port;
+  }
+  std::string uri = "connect://localhost:" + port;
+  m_conn->Connect(uri.c_str(), &error);
 
   return error;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66689.217481.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190827/a05c5dca/attachment.bin>


More information about the llvm-commits mailing list