首先,手机解锁后安装su。
小米 开发者模式的进入方法是设置...找到miui版本号后,连续点击多次(不同版本或手机可能不一样)
开启了usb调试后,插入PC端,依然无法adb 连接。
此时需要在拨号界面输入:*#*#717717#*#*
再次adb devices应该可以看到了,如果看不到,先adb kill-server。
至于tcp方式连接adb,一般手机,下载个超级终端,在其上输入: 1) stop adbd 2)setprop service.adb.tcp.port 5555 3)start adbd 就可以了。
但是小米不行~~~~~~
具体方法是:1)先usb方式adb连接 2)adb tcpip 5555 3)adb connect 192.168.1.100(此IP为手机IP,且需要PC可以访问)
此时pc端应该可以使用adb devices看到tcp方式的连接了
参考资料:https://stackoverflow.com/questions/19485467/adb-wireless-device-unauthorized
其中的:
Solution
1 Connect device(over USB) to computer.
2 Authorize adb device, so it can communicate(handshake over USB) with computer
3 Check that the device is connected
$adb devices
List of devices attached
SC8SDQWGKBT4JVS4 device
4 Change to tcpip mode
$adb tcpip 5555
restarting in TCP mode port: 5555
5 Connect device(over WIFI) to computer, make sure both are on the same network
$adb connect 192.168.1.100
connected to 192.168.1.100:5555
6 Authorize adb device, so it can communicate(handshake over WIFI) with computer
7 Check that the device is connected
$adb devices
List of devices attached
SC8SDQWGKBT4JVS4 device
192.168.1.100:5555 unauthorized
Although I authorized the device, adb is seeing things differently.
To get things working correctly, unplug device from USB because there is a connection over WIFI.
8 Kill the adb server
$adb kill-server
9 Connect again over WIFI
$adb connect 192.168.1.100
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to 192.168.1.100:5555
10 Finally, Check that the device is connect
$adb devices
List of devices attached
192.168.1.100:5555 device
Device is now authorized, you can start debugging over WIFI.