Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adb_client support #4

Open
axelkar opened this issue Jun 29, 2024 · 9 comments
Open

adb_client support #4

axelkar opened this issue Jun 29, 2024 · 9 comments

Comments

@axelkar
Copy link

axelkar commented Jun 29, 2024

As you said on Reddit, could you integrate adb_client into the project?

@SyedAhkam
Copy link
Owner

Aha yes, I'd love to but it seems they're missing support for the USB protocol so far which I feel would become a regression since we support it by default.

It seems they don't support installing apks from the client either.

How this could work is by using an experimental flag perhaps.

android --use-adb-client connect --port <custom_port> 192.168.29.1 # how to persist connection here without a daemon ??
android --use-adb-client shell
android --use-adb-client ... # other commands which could work similarly

or.. the worse method if we can't persist connections, you'd need to pass the host & port every single time you do an action

@axelkar
Copy link
Author

axelkar commented Jun 29, 2024

they're missing support for the USB protocol

That's a major issue that I didn't notice! Feel free to keep this issue for tracking

or.. the worse method if we can't persist connections, you'd need to pass the host & port every single time you do an action

Wireless ADB actually advertises an mDNS service on _adb-tls-connect._tcp so you can automatically connect
... and now I noticed that the project is missing support for wireless ADB too

So there is no real ADB client for Rust (e.g. doesn't just forward calls to adbd)

@cocool97
Copy link

Hey !

I just found you talked about adb_client crate which I'm maintaining.

Support for USB is available since 2.0.0 and wireless ADB is also coming (currently in a PR).

I would be happy to help you use my crate if you find it worth it :)

@SyedAhkam
Copy link
Owner

Hi @cocool97, thats cool man. it makes me happy.

I've long been interested in migrating to adb_client so that we can break free from the requirement of having adb as a cli installed!

@cocool97 do you mind going through the commands that android-cli support and see if adb_client can support all of those use cases?

if everything seems fine, I'll start the process of migration in a new branch.

@cocool97
Copy link

Can you rather provide me this list ? I'll complete it afterwards !

@SyedAhkam
Copy link
Owner

SyedAhkam commented Nov 11, 2024

Not too many atm.

Screenshot_20241112-012922.png

https://android-cli.syed.world/ - if you go here, you can see the adb commands it wraps.

@cocool97
Copy link

Is android build related to ADB ? If yes what is it ?

What is the difference between launch and run ?

From what I see the only missing function would be install, but it can be done using push and a shell command ( this is what is done by ADB server). I'll add this command in the next few days, this is not a big deal.

I think that you can start now using this library on a branch to see if everything is OK for you, this shouldn't be hard to use if you already have functions running standard "ADB" commands.

@SyedAhkam
Copy link
Owner

Actually no, android build calls ./gradlew so that is out of scope here.

launch calls adb shell am start -n com.example.demo/com.example.test.MainActivity which if adb_client supports acquiring a shell - we're fine here.

run is out of scope too.

I might not be able to pick this up until the upcoming weekend so it is alright you can go ahead and implement the install command.

@cocool97
Copy link

Install command is now available in version v2.0.3 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants