This is an archive of the discontinued LLVM Phabricator instance.

[Platform/Android] Read the adb server from an env variable if set
ClosedPublic

Authored by lanza on Aug 23 2019, 4:00 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

lanza created this revision.Aug 23 2019, 4:00 PM

Should we do this via a "settings set" setting instead of an environment variable? This would make it easier to test running a test suite kind of situation.

Also is this the server that runs on the host machine where LLDB resides, or remotely on the device? If this is something that would be done at "platform connect" time, each platform can have its own unique options and arguments to "platform connect". Might be better to just add them as options to the "platform connect" command. Something like:

(lldb) platform connect --adb-port 5037 --adb-path /path/to/adb --device MyPixel2

Added Pavel since he previously worked on Android LLDB at Google. Pavel, please add any additional reviewers to this patch that you think might be interested.

srhines accepted this revision.Aug 26 2019, 3:16 PM

Thanks for improving this for LLDB and Android.

This revision is now accepted and ready to land.Aug 26 2019, 3:16 PM
labath accepted this revision.Aug 26 2019, 11:52 PM

This looks good. I believe @srhines is the best person to review android-related things right now. I can also help with the lldb side of things.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2019, 1:14 PM