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

Upgrade adb to support Wireless debugging? #2

Closed
luciferz2012 opened this issue Aug 1, 2020 · 12 comments
Closed

Upgrade adb to support Wireless debugging? #2

luciferz2012 opened this issue Aug 1, 2020 · 12 comments
Labels
WIP On progress

Comments

@luciferz2012
Copy link

As described here https://developer.android.com/preview/features#wireless-adb

@rendiix rendiix added the WIP On progress label Aug 4, 2020
@tathastu871
Copy link

It was for android 11

@teou1
Copy link

teou1 commented Nov 15, 2020

Any progress with compiling adb 1.0.41 (api 30, Android 11) binaries for arm64?

It can be a gamechanger: adb phone to phone without the need for a pc the first time and without otg cables... And even adb to itself would be possible, when pairing command is supported.

@tathastu871
Copy link

tathastu871 commented Nov 15, 2020

Any progress with compiling adb 1.0.41 (api 30, Android 11) binaries for arm64?

It can be a gamechanger: adb phone to phone without the need for a pc the first time and without otg cables... And even adb to itself would be possible, when pairing command is supported.

Already possible to adb phone to phone via otg. Also adb to itself without need of another phone or pc via adb connect localhost

Just one step needs the pc that is setting up adb in tcpip mode after that its all pc free. And if phone is rooted that step is also gone

@teou1
Copy link

teou1 commented Nov 15, 2020

Adb to itself does not seem to work by me, Android 11 unrooted with termux and MasterX adb version:

$ adb connect localhost
unable to connect to localhost:5555: Connection refused
$ adb connect localhost:5037
unable to connect to localhost:5037: Connection refused
$ adb connect localhost:5038
connected to localhost:5038
$ adb devices
List of devices attached

$ adb shell
error: no devices/emulators found
$ adb disconnect
disconnected everything
$ adb version
Android Debug Bridge version 1.0.39
Revision android-8.0.0 arm

In a terminal emulator without termux i get even less, access denied or not exist.

And yes, i am aware of the other 2 possibilities -pc and otg cable, would be nice to get without them, pure wireless.

@teou1
Copy link

teou1 commented Dec 22, 2020

Thanks to osm0sis and surge 1223 we now have a solution to that problem.
So, download adb.bin somewhere on your phone from here https://github.com/Magisk-Modules-Repo/adb-ndk/tree/master/bin
Then use fx file explorer - connect to - left menu, termux, to authorize fx to see part of termux filesystem and transfer adb.bin there. Do not try to do it from termux itself: you'll be greeted with an error later on, because of the enforced no execution policy on Android 11 (good for virus protection, bad for power users, see here termux/termux-app#1072 ).
As next step you run termux and
chmod +x adb.bin
just to be sure.
Now you can
./adb.bin
and read the help how to pair and then connect. Remember there are different ports for pairing and connecting.

@shantnubiswas
Copy link

shantnubiswas commented Dec 27, 2020

Thanks to osm0sis and surge 1223 we now have a solution to that problem.
So, download adb.bin somewhere on your phone from here https://github.com/Magisk-Modules-Repo/adb-ndk/tree/master/bin
Then use fx file explorer - connect to - left menu, termux, to authorize fx to see part of termux filesystem and transfer adb.bin there. Do not try to do it from termux itself: you'll be greeted with an error later on, because of the enforced no execution policy on Android 11 (good for virus protection, bad for power users, see here termux/termux-app#1072 ).
As next step you run termux and
chmod +x adb.bin
just to be sure.
Now you can
./adb.bin
and read the help how to pair and then connect. Remember there are different ports for pairing and connecting.

Does it work for connection adb on same device without root if yes the what commands did you used?

I tried
/data/data/com.termux/files/home/adb.bin start-server
Then
adb connect localhost:5037

But when i tried list with both the commands they show but an empty list. And now i am depressed again please help me @teou1.

This is the adb i installed on my device

@teou1
Copy link

teou1 commented Jan 1, 2021

You are using the wrong binary (use the one from magisk) AND the wrong command :)
Do you have an Android with wireless debugging in the developer menu, android 11 and maybe 10? Have you tried a wireless connection with pin from a pc, to be sure everything works?

If you had, you had known, the new command is adb pair localhost:12345 , then adb connect localhost:54321
Read the help once more please.

What you are doing is ok for every android version, but with that method you still need usb cable to allow the connection once and to switch to tcp server. As i said...read the help and play everything once more on a pc first because right now you do not know what you are doing.
Here is a begginers guide (terrible site but the first google result)
https://android.gadgethacks.com/how-to/set-up-wireless-debugging-android-11-send-adb-commands-without-usb-cable-0302898/

@shantnubiswas
Copy link

You are using the wrong binary (use the one from magisk) AND the wrong command :)
Do you have an Android with wireless debugging in the developer menu, android 11 and maybe 10? Have you tried a wireless connection with pin from a pc, to be sure everything works?

If you had, you had known, the new command is adb pair localhost:12345 , then adb connect localhost:54321
Read the help once more please.

What you are doing is ok for every android version, but with that method you still need usb cable to allow the connection once and to switch to tcp server. As i said...read the help and play everything once more on a pc first because right now you do not know what you are doing.
Here is a begginers guide (terrible site but the first google result)
https://android.gadgethacks.com/how-to/set-up-wireless-debugging-android-11-send-adb-commands-without-usb-cable-0302898/

Can i use same steps on android 9? And i don't have any pc so if you can help me to do this without a pc then i will be very greatful of you(i know my english is bad please bare with me). •‿•

@teou1
Copy link

teou1 commented Jan 3, 2021

No. The new method is introduced in the middle of 2020 with some very late update of Android 10 and early beta of 11.

On android 9 you follow the old guides like https://support.honeywellaidc.com/s/article/How-to-use-adb-over-TCPIP-connect
You need a cable connection to start the server on port 5555 and then it will work wirelessly until you reboot the phone.

p.s. I have seen some apps on google play https://play.google.com/store/apps/details?id=com.htetznaing.adbotg that use 2 phones and otg cable, have not tried personally.

@rendiix
Copy link
Owner

rendiix commented Apr 13, 2021

update latest platform tools

@rendiix rendiix closed this as completed Apr 13, 2021
@chaoscreater
Copy link

on Android 11, turn on wireless debugging and look at the port generated (it'll be random everytime). Then in Termux, run:

adb connect localhost:port (where port is the one you got from wireless debugging). This will pair Termux to wireless debugging.

Once done, Termux should be able to run adb commands, such as "adb devices -l" to list the currently connected adb devices. All this is done without another device.

You can also run "adb tcpip 5555" (after the above steps have been completed) and this will allow Tasker or MacroDroid to run more ADB elevated commands.

The problem is trying to automate the first part. There's a Google Play app called LADB and once you've done the initial pairing of LADB with wireless debugging, then it'll survive phone reboot. This means that the next time you reboot your phone and run LADB (with wireless debugging turned on of course), LADB will automatically pair with wireless debugging. So it should also be possible for Termux to do the same.

@teou1
Copy link

teou1 commented Nov 14, 2021

And a small addition: might be needed to go split screen, because android changes the pin every time the window is refreshed.

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

No branches or pull requests

6 participants