cocool97 / adb_client

Rust ADB (Android Debug Bridge) client library
95 stars 19 forks source link

feat: should make crate usable on Windows #35

Closed cocool97 closed 2 days ago

cocool97 commented 5 days ago

This PR should make this crate usable on Windows as well

NutchapolSal commented 3 days ago

This now compiles and, with cargo test, all tests passed on Windows. I've tried some adb_cli commands and they do work, although adb_cli shell gets stuck doing nothing after running exit on the device, had to Ctrl+C to stop it. In my personal project, I've swapped out my version of adb_client with this branch and everything works fine for now. I do want to try use the shell function but I don't know how to use it with an in-memory buffer instead of a file.

cocool97 commented 2 days ago

Ok for the build, this is nice !

For the shell I have the same issue on my Linux system, I think that this is linked to the way I read from the Reader. I'll check it in another PR.

For the new shell API, you just have to pass a struct implementing Read and a structure implementing Write traits, and all the logic is handled by the method itself.