[Lldb-commits] [PATCH] Use Android device serial number instead of hostname as a target identifier within module cache.
ovyalov at google.com
Wed Mar 25 09:14:58 PDT 2015
Comment at: source/Plugins/Platform/Android/AdbClient.h:33-37
@@ -31,4 +32,7 @@
+ static Error
+ CreateByDeviceID (const char* device_id, AdbClient &adb);
AdbClient () = default;
explicit AdbClient (const std::string &device_id);
> ovyalov wrote:
> > tberghammer wrote:
> > > What is your opinion about using a proper factory pattern instead of this combined approach? If we worry about the performance implication caused by querying the device list every time then we can make that optional.
> > >
> > > Note: I plan to add a few more factory method to create an AdbClient based on -e (emulator) and -d (device) flags the same way as adb do it.
> > Do you mean to use separate factory methods to attach either to emulator or device?
> > Performance shouldn't be an issue here since it's one-off call and then device_id is stored inside PlatformAndroid.
> > Could you give more context why we need to distinguish emulator and device flows? I mean, once we have device_id (either emulator and real device) we can distinguish Android instances even when there are a few connected devices. As for me, from LLDB perspective either emulator or device should be treated identically.
> I plan to add some flags to "platform connect" in PlatformAndroid to specify which device we want to connect. My plan is to follow the same convention what is used by adb ([-s serial_number] [-e] [-d]) where if serial number is specified then connect based on that, if -e is specified then connect to the only running emulator (fail if more then 1 is running) and if -d is specified the connect to the only running device. Also fail if more then one flag is provided.
I see - makes sense.
More information about the lldb-commits