Using Android Debug Bridge (ADB) over Wifi
- On the target device running Android (using the serial console):
Turn on Wifi and connect to desired network from GUI
Settings >> Wireless and network >> Wifi settings…
- On the target device running Android (using the serial console from host):
stop adbd
setprop service.adb.tcp.port 6565
start adbd
- On the host machine
adbconnectDEVICEIP:6565 adb shell
Optional: To make property persistent on target
You can make the ‘service.adb.tcp.port’ property persistent if you want by making changes to source and rebuild.
This way you don’t have to repeat the commands in Step 2 above on target on every reboot. To do this, (Note: : Refers to android source top level directory.)
a. Copy buildspec.mk.default as buildspec.mk into android source top level directory
$ cp /build/buildspec.mk.default /buildspec.mk
b. Make the following change to the buildspec.mk
-#ADDITIONAL_BUILD_PROPERTIES +=
+ADDITIONAL_BUILD_PROPERTIES += service.adb.tcp.port=6565
c. Rebuild. (Refer to /build/core/config.mk for more info on customizing builds with buildspec.mk.)
d. To make sure the change worked, you can look at the generated /system/build.prop file you should see line
service.adb.tcp.port=6565
in that file.
Once you flash this system image into target, you should be able to skip Step 2 for successive boots. Actually you will not need to do Step 1 for every reboot as target remembers the network it connected to first time and automatically reconnects to same network. So you can just directly go to Step 3 for successive reboots.
Note: default adb port is 5555, and using another value is trivial security measure. However, adb access at all, and networked access foremostly, is utterly insecure and intended to be used only on development-only devices in a physically and networkedly controlled environment. Never enable those on a production-use device or on a device which may contain sensitive data. The same goes for unauthenticated root access.