mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 04:19:25 +08:00
[Platform/Android] Read the adb server from an env variable if set
Summary: The environment variable ANDROID_ADB_SERVER_PORT can be defined to have adbd litsen on a different port. Teach lldb how to understand this via simply checking the env var. Reviewers: xiaobai, clayborg Subscribers: srhines Differential Revision: https://reviews.llvm.org/D66689 llvm-svn: 370106
This commit is contained in:
@@ -137,7 +137,12 @@ const std::string &AdbClient::GetDeviceID() const { return m_device_id; }
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user