@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
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com