ADB over Wi-Fi
1.root
$adb root
2.设置tcp端口并重启tcpip服务
$adb shell setprop persist.adb.tcp.port 5555 && adb tcpip
3.连接
$adb connect <the target ip>
注意电脑与手机在同一网络下。
4.官方教程
https://developer.android.com/guide/topics/connectivity/usb/index.html
When debugging applications that use USB accessory or host features, you most likely will have USB hardware connected to your Android-powered device. This will prevent you from having an adb
connection to the Android-powered device via USB. You can still access adb
over a network connection. To enable adb
over a network connection:
- Connect the Android-powered device via USB to your computer.
- From your SDK
platform-tools/
directory, enteradb tcpip 5555
at the command prompt. - Enter
adb connect <device-ip-address>:5555
You should now be connected to the Android-powered device and can issue the usualadb
commands likeadb logcat
. - To set your device to listen on USB, enter
adb usb
.