I have a Lenovo TB_X606F, with stock Android 10. I managed to root the device, and I wanted to be able to have the device listen to port 5555 for adb connections over Wi-Fi, that is TCP/IP, at startup (otherwise, I have to connect it via USB to a PC, and issue adb tcpip 5555 on the PC, and then disconnect USB, every time I want to access the device with adb over TCP-IP/Wi-Fi, and I want to avoid having to do that).
I have seen:
- https://forum.xda-developers.com/t/seeking-advice-on-rooting-smart-tab-m10-fhd-plus-2nd-gen.4080371/
- https://forum.xda-developers.com/t/solved-manually-enable-adb-debugging-from-recovery.2335799/page-3
- https://stackoverflow.com/questions/12251101/how-to-enable-adbd-to-listen-to-a-port-at-boot-time-in-android
- https://stackoverflow.com/questions/51943937/unable-to-use-adb-connect-to-enable-wifi-debugging
- https://forum.xda-developers.com/t/adb-missing-popup-debugging-authorization-permission.4484757/
- How can I enable Android Debugging from a root shell on the phone?
- How to enable adbd to listen to a port at boot time in Android?
... and I performed these commands, rebooting the device after each command to test:
$ adb shell
X606F:/ $ su
X606F:/ # setprop persist.adb.tcp.port 5555
X606F:/ # setprop persist.sys.start.adb 1 # here it started allowing connections, but unauthorized
X606F:/ # setprop persist.service.debuggable 1
X606F:/ # setprop persist.service.adb.enable 1
X606F:/ # settings put global adb_enabled 1
Now, when the device is rebooted and goes online, I can do on my Linux PC:
$ adb kill-server
$ adb devices -l
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
$ adb connect 192.168.0.10:5555
connected to 192.168.0.10:5555
$ adb devices -l
List of devices attached
192.168.0.10:5555 unauthorized transport_id:1
The problem is, once I've done adb connect, the "Allow USB debugging" never shows up on the tablet, and therefore I cannot allow the debug connection, and therefore it remains unauthorized. So, I cannot run anything:
$ adb shell
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Yup - I have checked "for a confirmation dialog on your device" - it did not show up, wish it did ...
Funnily, if I thereafter plug the tablet device to the PC, I do get the "Allow USB debugging" prompt/popup/dialog - when I allow it, I get this:
$ adb devices -l
List of devices attached
HA1HA1HA unauthorized usb:2-1.2 transport_id:2
192.168.0.10:5555 device product:LenovoTB-X606F_EEA model:Lenovo_TB_X606F device:X606F transport_id:1
... basically, now the TCP/IP/Wi-Fi connection is authorized, and the USB one is not ?!
So - how can I enable adb access over Wi-Fi (TCP/IP) on this device, such that when I connect to the device with adb from a PC, I get a prompt to "Allow USB debugging"?