Wifi ADB debug mode lost on restart?

Dimlos

Well-known member
I did adb tcpip 5555 with nmap and LADB in my environment as soon as possible, but the problem was not reproduced.
I can't upload the video because I don't have time right now, but if there is an easy way to reproduce the problem, please let me know.
 

Endercraft

Moderator (& bug finder :D)
I did adb tcpip 5555 with nmap and LADB in my environment as soon as possible, but the problem was not reproduced.
I can't upload the video because I don't have time right now, but if there is an easy way to reproduce the problem, please let me know.
I can enter any information, but when confirming the action is lost no matter what I do.
 

Dimlos

Well-known member
I can enter any information, but when confirming the action is lost no matter what I do.
I set up a new setup with an Android 12 Xiaomi device to bring the environment closer.
There is no problem with the plugin working in my environment as shown in the video.

Redmi note 11 / MIUI13.0.8 / MacroDroid v5.32.8 Pro / MD Helper1.8

nmap_movie.mp4
 

Endercraft

Moderator (& bug finder :D)
I set up a new setup with an Android 12 Xiaomi device to bring the environment closer.
There is no problem with the plugin working in my environment as shown in the video.

Redmi note 11 / MIUI13.0.8 / MacroDroid v5.32.8 Pro / MD Helper1.8

nmap_movie.mp4
I figured it out. Using some clone worked.

Also, I know we are trying to enable TCP connection here but... Anyone knows the command to stop TCP ?
 

Dimlos

Well-known member
Basically, adb usb will put you in USB connection mode, but if you run adb tcpip 5555, you will get disconnected, so you need to reconnect and run the command.

If you have multiple devices connected, you will get an error, so you need to check with adb devices.

I have included a screenshot of when it worked relatively well, but I think it is easier to reboot so you don't have to remember the commands.
 

Attachments

  • adb usb.jpg
    adb usb.jpg
    437.2 KB · Views: 14

Dimlos

Well-known member
There are two types of nmap.sh available to the public, one for general use and one for Samsung.
Recently, a few nmap.sh for Samsung have been downloaded, but we recommend you to use LADB because nmap is unstable on Samsung devices.
 

BenS8

New member
There are two types of nmap.sh available to the public, one for general use and one for Samsung.
Recently, a few nmap.sh for Samsung have been downloaded, but we recommend you to use LADB because nmap is unstable on Samsung devices.
Hi Dimlos,
Ithought I would register to provide some info I got from testing on Samsung tab S8+ Android 13 :
- I have a port set at 46349, so the 45000 upper limit in nmap.sh for Samsung ( PORTS=`nmap -sT -p30000-45000 --open localhost | grep "open" | sed -r 's/([1-9][0-9]+)(\/tcp.+)/\1/'`) is wrong
- simply running
nmap -sT -p46000-47000 --open localhost
in Termux, is unreliable. I might have to run it like 4 times to get my current 46349 port show up. (I reduced the port range for testing)

nmap -sT -p46000-47000 localhost
without --open, on the other hand, seems reliable. But it takes like 4 times longer to run.

I don't understand what the "--open" option is really doing. Maybe not scanning all ports in the requested range?

Obviously this has nothing to do with what is specific to nmap.sh for Samsung (fakeroot for adb connect), and will be at least one cause of problems with that script.

Hope this helps, even it is is not a solution.
 

Dimlos

Well-known member
@BenS8
I know that for some reason nmap takes a very long time to run on Samsung devices.
I have managed to make a script to get it to work, but I can't seem to find the port easily, so it may be a failure.
 

Endercraft

Moderator (& bug finder :D)
I can enter any information, but when confirming the action is lost no matter what I do.
@Dimlos remember the above problem ? I tried running some simple shell scripts (which returned "Terminated shell script. Unknown Termination" or something in the lines of that) and for some unknown reason it's back - well I can still use the plugin action but some actions do as well this bug was active.
 

Dimlos

Well-known member
If you can provide us with your current environment and scripts, we will try to verify it here as well.
 

Endercraft

Moderator (& bug finder :D)
I'm not sure how you could reproduce my environment, it is pretty complex with all the macros and settings..
What would you need exactly ?
 

Dimlos

Well-known member
What version of Android and MacroDroid do you have?
Is the problem with Termux or ADB Shell [Tasker Plugin]?
We can't have a perfect environment, but we would like to verify in an environment as close as possible.
 
Last edited:

Endercraft

Moderator (& bug finder :D)
The problem isn't with the plugin anymore it's with MacroDroid itself.
Android 13 (happened with Android 12 too), MacroDroid v5.38.5 (happened on a previous version too). It seems to happen in very rare cases as I haven't heard of anyone else having it.
 

Dimlos

Well-known member
If it is due to your complex environment, then my verification would be pointless.
Is the problem that the return value of the plugin is not coming back?
 

Dimlos

Well-known member
I can confirm that I can get the port with nmap on Android 12 / MacroDroid v5.37.12 without any problem.
If there is anything I can do, I can try it when I have time.
 

Endercraft

Moderator (& bug finder :D)
Don't worry, it doesn't affect the plugin action whatsoever anymore. The if clause action I still affected but is not that noticeable.
 

chaoscreater

Active member
I haven't been following the replies on this thread, so I have no idea what's going on anymore. I switched to using root on all my devices for the past few years and didn't really need the adb tcpip 5555 method anymore.

However, I recently bought a device that I can't root because it'll break a few things, such as Widevine L1 for Netflix, among other things. So I've decided to revisit the adb tcpip 5555 method once more.

I ended up creating another solution that is pretty consistent and easy to use. It's currently working on my Redmi K60 running MIUI 14, Android 13. You need Termux and Termux Tasker plugin for this to work.

Basically, I just need to open the Wireless Debugging page under Developer Settings. Then, read the screen contents and grab the values under "IP address and Port". Note that at this step, I don't need to pair my device and enter the pairing code. It's not required.

Once I have the IP address and port (e.g. 192.168.0.140:34551), I then pass this into Termux via the Termux Tasker plugin. It will do a adb connect 192.168.0.140:34551 and then once connected, it will do adb tcpip 5555 and voila, it's working now.

I've uploaded my macro to the template store. Macro id is 21169 and the name is "Switch ADB Mode".

My macro includes the things I've discussed above but also does other things as well. You can ignore those extra stuff if you don't need them. The macro basically uses a MacroDroid quick tile and I can toggle it to turn on ADB USB mode or ADB TCPIP 5555 mode. When ADB TCPIP 5555 mode is toggled, it'll execute the actions described above.

UPDATE:

Found an even better method. You'll need the Wirebug app from F-Droid store. You can then use another macro that I've created (id = 21171) to get it running. You just need the IP to use adb connect, you don't even need the port. It's very easy to get the IP (it'll show on the Wirebug app and you can do a Read Screen Contents and then extract it), or use the builtin Macrodroid magic text {ip} to get the current IP.

Note that during my testing, turning on Wireless Debugging and using adb connect IP_address is not enough. I needed to use Wirebug to enable wireless debugging from the app, then I can use adb connect IP_address and after that I can run adb tcpip 5555. I'm not sure what Wirebug is doing in the background after you enable debugging in the app, but hey it works.
 
Last edited:
Top