1. make sure adb is listening on tcp port on device
$host$ adb shell setprop service.adb.tcp.port 5555
restart adbd on device
$host$ adb shell netstat -an -t
Active Internet connections (servers and established) #### android device
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 :::5555 :::* LISTEN
$host >> netstat -an -t |grep 6000 ### PC host $host$
TCP 0.0.0.0:6000 0.0.0.0:0 LISTENING InHost
2. Root device and forward tcp port on host side
$host$ adb root && adb remount && adb forward tcp:6000 tcp:5555
TCP port Map $$$ ($host$ ):6000 ====> (AndroidDevice):5555
3. SSH tunnel between adb host($host$ ):6000 and remote build server($server):16000
TCP port Map ($server):16000 ======> ($host$ ):6000 ====>> (AndroidDevice):5555
SSH tunnel formward from ($server):16000 to Windows ADB host/$host$:6000
Windows Adb start SSH tunnel between Linux build server/Remote and Windows ADB
Example3.1
C:\Android\adb>ssh -NR 16000:localhost:6000 root@192.168.1.1
root@192.168.1.1's password:
====>Forward OutSideHost/Linux build server/Remote 192.168.1.1:16000 to WindowsPC adb local TCP/6000
## make sure SSH tunnel on Linux build server/Remote is Open/TCP/16000
root@OutSideHost:/localrepo/root/rm/jci/rm/engine$ netstat -an --tcp |grep 16000
tcp 0 0 127.0.0.1:16000 0.0.0.0:* LISTEN
tcp6 0 0 ::1:16000 :::* LISTEN
Example3.2
Putty ->SSH tunnel Setting for SSH root@192.168.1.1
===>4R16000 localhost:6000 ---> Select Remote (forward)
4. Push new app from remote build server $server
lake@server:~/local/aosp$ adb connect localhost:16000
connected to localhost:16000
lake@server:~/local/aosp$ adb push out/target/product/aosp/system/bin/appbin /system/bin/appbin
[100%] /system/bin/appbin
lake@server:~/local/aosp$ adb reboot