Prerequisites

  • Android device rooted with Magisk
  • Basic knowledge of ADB and shell commands

For more information about Magisk boot scripts, see the official documentation.

Setup Instructions

  1. Create a new script file named script.sh in the /data/adb/service.d directory with the following contents:
#!/system/bin/sh
setprop service.adb.tcp.port 5555
stop adbd
start adbd
  1. Make the script executable by running:
chmod +x /data/adb/service.d/script.sh
  1. Reboot your device for the changes to take effect.

After rebooting, your device will automatically enable ADB over TCP/IP on port 5555. You can connect to it using:

adb connect <device-ip>

Notes

  • Make sure your device is connected to the same network as your computer
  • For security reasons, only enable this on trusted networks
  • The ADB TCP connection will be available as long as the device is powered on and connected to the network