A better way to accommodate custom adb calls
This came up in a discussion with @winterfroststrom
The AdbProxy was designed for the most straightforward use cases, like adb.shell('getprop') - simple call and return.
This does not work well if users want to have more control of the call. E.g. process the live streaming of the stdout of the call subprocess.
We might want to consider providing a new adb interface for users who want to make long-running calls and have more control of the subprocess.
This issue looks interesting to me. I can work on this issue if granted and this is still a valid issue. Thanks!
This has not come up a lot recently, so it has not been a priority. I'm thinking maybe a logcat service pub-sub mechanism is probably good enough for most users.
What idea do you have in mind for the adb level API? Can you share some high level examples? :)
Thanks for your attention! It all depends on the requirements we have. e.g.:
This does not work well if users want to have more control of the call.
E.g. process the live streaming of the stdout of the call subprocess.
We might want to consider providing a new adb interface for users who want to make long-running calls and have more control of the subprocess.
If I can have more information about the discussion you had with @winterfroststrom so to learn more about details about requirements and your expectation on the result of this issue, then I can come up with a high-level proposal on API design for your review. Again, thanks for your asking and look forward to making a contribution to this repo.
I see.
So basically, there is no good support for non-blocking long running adb commands today.
E.g. the adb logcat service has to use a raw start_standing_process call, and manage the process directly, in addition to handling the stdout and stderr.
So the idea for this request is to create a mid-layer between raw process management and AndroidDevice services for adb commands.
Understood!
Let me study some existing packages such as invoke, python-shell, pexpect and python-rrmngmnt to see if there is anything we can learn from them and then will propose a design document (module with API usage) for your review. Thanks!
Hi,
I made up slides as the proposal for this issue. Please check this link:
- P2: Description of this issue
- P3-6: The study of the original implementation
- P7-8: The proposal for this issue.
Any advice and feedback are appreciated. Sorry for the late response and look forward to your lesson. Many thanks!