首先了解三个命令,"adb tcpip","adb usb","adb forward"
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
adb usb - restarts the adbd daemon listening on USB
adb forward --list - list all forward socket connections.
the format is a list of lines with the following format:
<serial> " " <local> " " <remote> "\n"
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb forward --no-rebind <local> <remote>
- same as 'adb forward <local> <remote>' but fails
if <local> is already forwarded
adb forward --remove <local> - remove a specific forward socket connection
adb forward --remove-all - remove all forward socket connections
1. 使用USB数据线连接设备。
2. 在命令行输入adb tcpip 5555 ( 5555为端口号,可以自由指定)。
3. 断开 USB数据,此时可以连接你需要连接的|USB设备。
4. 再计算机命令行输入 adb connect <设备的IP地址>:5555
后面就可以使用ADB ,DDMS 来调试Android应用或显示Logcat 消息。
5. 如果需要恢复到USB数据线,可以在命令行输入adb usb
注: Android设备的IP地址可以在Settings->About Phone->Status 查到
参考自:
http://blog.csdn.net/daditao/article/details/19077281