dadb
dadb copied to clipboard
Add support for `adb pair` (connecting with Android 11+ over Wi-Fi)
Is the pair command supported by Dadb? If not, it would be great to add this feature.
https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+
Hi @sharpordie - I'd like to understand your use case a bit better.
Today the following is supported:
- Pair your device over wifi using the standard
adb pair HOST:PORT CODE
command. eg:adb pair 10.0.0.192:5555 123456
- Once your device is paired, you can connect to your device using your device's IP address (same as HOST above):
Dadb.discover(10.0.0.192)
orDadb.connect(10.0.0.192, 5555)
.
These steps requires the adb
binary to initially set up the pairing, but since this is a one-time setup per laptop maybe that acceptable.
Do these steps satisfy your use case or are you looking for something else?
Btw I just added documentation on this in the README: https://github.com/mobile-dev-inc/dadb/blob/master/README.md#connecting-to-a-physical-device
But I'm still interested in whether this solves your use case or if there's a reason you'd need / prefer built-in wifi pairing support in dadb?
@sharpordie Please don't hesitate to reopen this issue if the above documentation doesn't work for your usecase!
Dadb is presented as a library to connect to android device without an adb binary or server. So for me using adb binary to pair (or connect) a device first is a nonsense.
But it requires to find out how the official adb forges the "request" for pairing process for a proper dadb implementation.
Here is a adb pair
implementation: https://github.com/RikkaApps/Shizuku/blob/master/manager/src/main/jni/adb_pairing.cpp
And here is a pure java implementation: https://github.com/MuntashirAkon/libadb-android/blob/master/libadb/src/main/java/io/github/muntashirakon/adb/PairingAuthCtx.java
@tiann This is exactly what I would like in Dadb (with Kotlin).
Not sure on timeline yet but opening this back up as it does seem like a use case folks are asking for.
This would certainly be a game changer. I'd be willing to put forward some work into this as best I can. This library opens up so many possibilities.
Hi dadb team, You guys made a great library. I would like to ask that any progress on this issue. Because i'm also want to pair using dadb and don't want use adb binary either
Yes, I'd like to add my voice to the other requests to add a pairing option to dadb. We really need it for devices running Android 11+. Thank you.
We really need adb pair