Wifi ADB debug mode lost on restart?

lassos

New member
so for me it doens't work. if i restart or reboot the device i always have to turn on wifi debug modus manually. only if wifi debug modus is turned on manually i can connect to random port. connecting via termux with dynamich port and change to 5555 works. but it make no sense if i am at other location and have no direct acces to phone i have no chance to remote control. airdoid and teamviewer can. i always have to do it all manuall after reboot. snurres macroid hack does not enable wifi debug mode automatically.

also tried this
adb shell pm grant com.arlosoft.macrodroid android.permission.WRITE_SECURE_SETTINGS
adb shell settings put global adb_wifi_enable 1


edit: so i need a way to turn on wifi debug mode automatically after reboot. i havens found a solution yet .

so i still need aidroid or teamviewer to connect to the phone and start wifi debug mode .-(
 
Last edited:

NwWork

New member
@tanutanu
Hi saw you had explored Termux, MD and LADB and even Tasker to achieve continuous us Android to pc connection without it disconnecting each time.

Can you tell me the commands to set it up on Termux pls. Since I am trying to keep scrycpy running continuously but when I lock screen of Redmi Note 11 WiFi debugging auto turn off and then new IP assigned to your WiFi network even after set WiFi to static the wireless debugging ip and port is changing...
 

drdedus

New member
hello can we enable wireless debugging only in specifics SSid s and turn off in all the others?
is there any template for that?
 

Endercraft

Moderator (& bug finder :D)
hello can we enable wireless debugging only in specifics SSid s and turn off in all the others?
is there any template for that?
I have created a macro for just that (ADB Hack required) :
Wireless_debugging_on_certain_SSIDs.png
In the allowed networks variable, you can create a list of networks where wireless debugging will be enabled, else it will be disabled. For example : Wi-Fi 1,Wi-Fi 2
Note that Wi-Fi 1Wi-Fi 2 will also work, as well as Wi-Fi 1#$&3&$Wi-Fi 2.
 

Attachments

  • Wireless_debugging_on_certain_SSIDs.macro
    3.9 KB · Views: 9

Dimlos

Well-known member
@chaoscreater method of getting the port number from logcat is stable up to Android 12, but does not seem to work on Android 13.
I was trying @tanutanu script, but it seems to fail to get the port number with about 3 ports open.

I'm not as expert as @tanutanu, so I'm sure there are many mistakes, but I managed to get it to work with a little ingenuity.
If you have time, please set it up and give it a try.

I think it is for advanced users as it requires installation of Termux, Termux:Tasker, ADB Shell [Tasker Plugin], and nmap to run.
We cannot provide support for setup, so please do your own research on the net and do your best.

I am trying to repeat the macro until it succeeds even if it fails, but I am sure there are others who know more about this than I do, so if you have any problems, please improve it and upload it.

nmap.sh
 

Attachments

  • adb_tcpip_5555.macro
    13.1 KB · Views: 29
Last edited:

Dimlos

Well-known member
The macro does not work just by downloading it, but requires various settings since it is designed to start the script from the macro.
 
Last edited:

Christoph

Member
I have installed Termux, Termux:Tasker and ADB Shell (tasker plugin).

nmap.sh

In which directory do we need to place this bash script file ?

1680088341570.png

Did you need to enter this apt install nmap for Nmap ?

Is the app LADB (https://play.google.com/store/apps/details?id=com.draco.ladb) needed?
 

Dimlos

Well-known member
It would take quite a long time to explain the setup, but would you still like an explanation?
I didn't set it up recently either, so my memory is a bit fuzzy.
 

Dimlos

Well-known member
I'm not sure if explaining the setup here will help many of you.
If more than one person wants me to write about it, I will try to explain it.
 

Christoph

Member
I am actually very interested to know to implement it on my Android too. The result is very interesting, having ADB over Wifi after every reboot.
I have already updated all my apt packages on Termux for it.
 

Dimlos

Well-known member
Install Termux and Termux:Tasker from F-Droid and execute the following command in Termux.
If you installed from the Play Store, uninstall try again.

apt update
apt upgrade
pkg install vim
pkg install nmap
pkg install android-tools
mkdir -p ~/.termux/tasker
cd ~/.termux/tasker

That's all for today.
 

Christoph

Member
apt update
apt upgrade
pkg install vim
pkg install nmap
pkg install android-tools
mkdir -p ~/.termux/tasker
cd ~/.termux/tasker

I have done them til the end :
1680103272240.png

I guess we now need to move nmap.sh into this folder: how do you do that, I guess it be done with a File Explorer App.
 

Dimlos

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

Attachments

  • Wireless debugging.jpg
    Wireless debugging.jpg
    222.1 KB · Views: 31
  • split screen.jpg
    split screen.jpg
    280.9 KB · Views: 33

Dimlos

Well-known member
Termux permission allow

MacroDroid app info
Run commands in Termux environment
 

Attachments

  • MD permission.jpg
    MD permission.jpg
    181.3 KB · Views: 22
  • Run Termux.jpg
    Run Termux.jpg
    158.5 KB · Views: 19

Dimlos

Well-known member
Then start from the macro and check the operation.
If a success popup appears, ADB Shell [Tasker Plugin] should now be available.
 

Attachments

  • Macro.jpg
    Macro.jpg
    779.3 KB · Views: 36
Top