Wifi ADB debug mode lost on restart?

Christoph

Member
@Christoph
First, run it from Termux and get it working before moving on to the next step.
I will upload an image of the successful result.
I have tried just the bash shell from Termux and here is the result:
1680265662766.png

I am very surprised by the outcome: why does the first ./,nmap.sh show No output and the 2nd ./nmap.sh shows an output ?
I haven't done anything between the two, except the chmod. I had already done the chmod yesterday on this file for sure (there is even the screenshot of it that I have shared here), so it should already have the execution right.
 
Last edited:

Christoph

Member
I have then run the macro: I get failed message
1680266059256.png

Here is the corresponding system log:
1680266261373.png
apparently it cannot connect to tcp:5037
 
Last edited:

Dimlos

Well-known member
The script seems to be working but adb tcpip 5555 is not succeeding.
In this case the macro is supposed to run the macro again, but it is not working.
Try editing the Macro Run action and re-selecting This Macro and re-running the macro.
 

Christoph

Member
The script seems to be working but adb tcpip 5555 is not succeeding.
In this case the macro is supposed to run the macro again, but it is not working.
Try editing the Macro Run action and re-selecting This Macro and re-running the macro.
I have done it. When editing the Macro Run I have used the default config that is:
1680271604395.png

But I still have failed message. In the system log, I do not have the cannot connect error though :
1680271593868.png
 

Dimlos

Well-known member
@Christoph
Additional instructions for Samsung devices.

pkg install fakeroot
export ADB_SERVER_SOCKET=localfilesystem:/data/data/com.termux/files/adb_socket
export ANDROID_NO_USE_FWMARK_CLIENT=1

Wireless debugging
Use split screen
Pair device with pairring code
fakeroot adb pair 192.168.0.xx:xxxxx
Enter pairing code:xxxxxx

Then replace it with nmap.sh for Samsung.

chmod +x nmap.sh
./nmap.sh
 

Dimlos

Well-known member
It worked in testing but seems to lack stability.
Apparently, the problem is caused by Samsung's modifications to Android.
 

Christoph

Member
It works ! Thank you 🤩
And I agree, I have also noticed it is not fully stable. This is why you have created a loop in the macro?


What are the paired devices corresponding to ? (before installing Termux, I only had the 1st one)
  1. chris@DELL53: This is Wifi debug pairing of my S20 with my Dell PC, I suppose
  2. root@localhost: This is due to "fakeroot adb pair 192.168.0.xx:xxxxx". It is pairing my S20 to Termux via fakeroot. Is it correct and formulated correctly?
  3. unknown@unknown: Do you know what is it ? do you also have this too ?
  4. uO_a420@localhost: This is due to "adb pair 192.168.0.xx:xxxxx". It is paring my S20 to Termux via adb . Is it correct and formulated correctly?
1680283565297.png
 

Dimlos

Well-known member
As for the issue of it not working stably, it seems that when you run Nmap, it doesn't show the details.
Samsung does not show up, but Xiaomi and Google do.
When I run nmap -sT -p30000-45000 --open localhost in Termux, does it always show the details?
 

Attachments

  • Xiaomi.jpg
    Xiaomi.jpg
    426.7 KB · Views: 11
  • Samsung.jpg
    Samsung.jpg
    241.4 KB · Views: 11

Dimlos

Well-known member
I found out how to easily and stably run adb tcpip 5555 after reboot.
I used the paid app LADB for this method; LADB gives me an error but the ADB Shell [Tasker Plugin] actually works.

Install LADB
Use split screen
Wireless debugging
Pair device with pairring code
Port xxxxx
Pairing code xxxxxx

Select More from the menu
Startup command
Add adb tcpip 5555
Import macros and restart
 

Attachments

  • Pairing.jpg
    Pairing.jpg
    233.1 KB · Views: 22
  • More.jpg
    More.jpg
    98.1 KB · Views: 22
  • Startup command.jpg
    Startup command.jpg
    195.6 KB · Views: 23
  • Macro.jpg
    Macro.jpg
    615.2 KB · Views: 26
  • reboot_adb_tcpip_5555.macro
    10.5 KB · Views: 8

Endercraft

Moderator (& bug finder :D)
@Endercraft
I am not sure what the problem is, but is there an easy way to reproduce it?
If it is caused by wireless debugging being on, it is possible to turn it off.
We have started the script and checked the operation with ADB Shell [Tasker Plugin], and the problem is not particularly problematic.
Sorry for the late reply.
This is something I have told @MacroDroidDev, however he wasn't able to reproduce it (unless the don't keep activities setting is enabled, which isn't for my device). There was some kind of fix, but the problem still persists - just a bit less noticeable.
 

Dimlos

Well-known member
I was told by r/termux how to search for ports in the background even on Samsung devices.
However, when I tested it on my device, it took about 2 minutes, so I think it would be better to use LADB for Samsung devices.
 
Top