Tested on a HTC G1 and on a x86 computer running Android port:
On a terminal emulator, or remote shell connected to the device:
To enable:
setprop service.adb.tcp.port 5555
stop adbd
start adbd
From the host PC:
./adb connect 192.168.1.100:5555
./adb logcat
./adb …
To disable:
setprop service.adb.tcp.port -1
stop adbd
start adbd
After disabling, ADB will continue to work using USB cable
Needs root of course.