Requirements:
- Packages:
android-tools,nmap - Apps: Termux:API (for
termux-notification)
Optional:
- Termux:Boot: Run the script at boot (preferably, add some delay)
- Termux:Widget: Run the script from a home screen shortcut
Tips:
- Enable wireless debugging before port scanning begins. If no port is found, tap the script notification to rerun the scan.
- Add "Wireless debugging" from Quick settings developer tiles to toggle wireless debugging from the notifications pane.
- It's a good idea to semi-automate the script using one of the termux apps listed above.
Can't find how to add description to gists so here's the gist of this script: