This is an archive of the discontinued LLVM Phabricator instance.

Respect `ANDROID_SERIAL` environment variable used by ADB
ClosedPublic

Authored by ldrumm on Jul 6 2016, 9:51 AM.

Details

Summary

Respect ANDROID_SERIAL environment variable used by ADB

When multiple Android devices are attached, the default behaviour of ADB
is to resolve a device number based on the presence of ANDROID_SERIAL if
the serial number is not explicitly passed by the -s parameter. This patch
emulates that behaviour in lldb's ADB platform connector

Diff Detail

Event Timeline

ldrumm updated this revision to Diff 62896.Jul 6 2016, 9:51 AM
ldrumm retitled this revision from to Respect `ANDROID_SERIAL` environment variable used by ADB.
ldrumm updated this object.
ldrumm added reviewers: tberghammer, ovyalov.
ldrumm set the repository for this revision to rL LLVM.
ldrumm added a subscriber: lldb-commits.
ovyalov added inline comments.Jul 6 2016, 2:33 PM
source/Plugins/Platform/Android/AdbClient.cpp
115

Could you check whether serial number coming from ANDROID_SERIAL is within connect_devices?

ldrumm updated this revision to Diff 63055.Jul 7 2016, 5:24 AM
ldrumm removed rL LLVM as the repository for this revision.
  • Ensure if ANDROID_SERIAL is set, it exists in the list of connected devices (Address feedback from @ovyalov)
  • Also add a hint in the error message in case multiple devices are attached and no serial number is available.
ovyalov accepted this revision.Jul 7 2016, 10:09 AM
ovyalov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jul 7 2016, 10:09 AM
This revision was automatically updated to reflect the committed changes.
ldrumm marked an inline comment as done.