POC: use of adb_client in xtask/daemon.rs #184
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This regards #166.
The goal of the issue is to replace the current Python script for pushing and running the binaries on the emulator with a more robust Rust implementation.
My current knowledge is not sufficient to continue working on the task, so for now it remains a proof of concept.
With the current changes, the daemon gets pushed and ran on the client via the newly added crate
adb_client
. I have encountered several problems:adb_client::ADBServerDevice::shell_command
blocks until the respective shell command is finished. This means that background execution of the daemon is only possible via thread. However, standard threads are difficult to terminate,pkill
is suboptimal.An alternative is
adb_client::ADBServerDevice::shell
, this gets a reader and a writer, which could then be used to terminate the daemon. However, I do not (yet) know how to use it.Another possibility might be to create a grpc endpoint which can send a death pill to the daemon and thus terminate it cleanly.
There is also another crate that might be interesting: https://docs.rs/adb-client-tokio/latest/adb_client_tokio/
Usage
cargo xtask integration-test
: broken because of issues abovecargo xtask daemon --android
: working without background flag.cargo xtask daemon
: starting, but daemon not killed after pressing Ctrl+C.cargo xtask client
: Unchanged.Thanks @fhilgers for the many attempts to help.