ADB/Android debug bridge command line-remote forward update app

23 篇文章 0 订阅
19 篇文章 0 订阅

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值