当前位置:   article > 正文

Android调试技巧之远程连接adb_adb远程连接

adb远程连接

在Android系统调试时,有时候不具备连接数据线USB调试的情况,我们就可以通过WIFI连接adb进行调试。

前提条件
二台设备需要处于同一局域网内,连接同一WIFI即可

连接步骤

1.开启并连接WIFI,需要连接USB数据线,找到设备,输入命令

C:\Users\Admin>adb devices
List of devices attached
276fcf  device

C:\Users\Admin>adb tcpip 5555
restarting in TCP mode port: 5555
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

2.断开USB数据线,在Androids设备上查看IP地址或者使用ifconfig命令查看,并记住IP

C:\Users\Admin>adb shell
trinket:/ $ su
trinket:/ # ifconfig
wlan1     Link encap:Ethernet  HWaddr c2:55:11:c0:19:9a  Driver icnss
          inet addr:172.16.9.2  Bcast:172.16.9.255  Mask:255.255.254.0
          inet6 addr: fe80::7d21:3b2a:444a:a0ac/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8778 errors:0 dropped:2 overruns:0 frame:0
          TX packets:800 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3000
          RX bytes:2274676 TX bytes:91619
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

3.通过IP地址连接adb:adb connect ip,即可进行adb调试

C:\Users\Admin>adb connect 172.16.9.2
connected to 172.16.9.2:5555
  • 1
  • 2

4.断开adb连接:adb disconnect ip

C:\Users\Admin>adb disconnect 172.16.9.2
disconnected 172.16.9.2
  • 1
  • 2

5.连接USB数据线,切换到USB模式

C:\Users\Admin>adb usb
restarting in USB mode
  • 1
  • 2
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号