I cannot use adb connect
to connect via wifi to my device (nexus 5, android 6), but since i\'m developping a cordova plugin using usb OTG, I really need to connect
I have tried everything but still, nothing worked for me. Then randomly, I used the following command:
$ adb tcpip 5555
error: no devices/emulators found
$ adb connect 192.168.0.104:5555
failed to connect to 192.168.0.104:5555
$ adb connect 192.168.0.104:5555
already connected to 192.168.0.104:5555
It was connected at this point but my device was offline. I was always able to connect at the second attempt but my device was always offline. At this point, I connected my device to my PC with USB.
$ adb tcpip 5555
error: more than one device/emulator
$ adb disconnect
disconnected everything
$ adb tcpip 5555
restarting in TCP mode port: 5555
$ adb connect 192.168.0.104:5555
connected to 192.168.0.104:5555
I disconnected my USB and voila! my device was still connected. I am sorry but I can't explain why it worked. I was randomly trying different things on internet. I had used the same commands several times but in different orders but they didn't work. I hope it will help someone.
I had the same problem. The solution was as follows.
In Developer Options. + Activate "Allow ADB debugging in load only mode." + In Spanish, "Permitir depuración ADB en modo solo carga."
Explanation My problem was as follows: I was doing all the steps:
After completing these steps, I disconnected the phone from the USB cable, and the connection was lost, I could not make the wireless connection.
However, this worked for me on a Huawei ALE-23 cell phone, but it did not work for me on the Huawei Y9S cell phone (Android 10), it failed.
I solved it only by activating the option "Allow ADB debugging in load only mode" in the cell Huawei Y9S.
Cheers!!!.
I ran into this same issue on not being able to connect via Wi-Fi but was using the snap version of scrcpy
. I kept seeing messages like adb server version (40) doesn't match this client (39); killing...
when I would run adb
or scrcpy
commands but it still worked, until I tried to connect over Wi-Fi.
$ scrcpy
INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
adb server version (40) doesn't match this client (39); killing...
* daemon started successfully
adb: error: failed to get feature set: no devices/emulators found
ERROR: "adb push" returned with value 1
I believe this means it was unable to push the server app to the device.
Running the commands to setup Wi-Fi using the adb built into the snap, scrpy.adb solved this for me.
$ scrcpy.adb tcpip 5555
$ scrcpy.adb connect 192.168.1.25:5555
connected to 192.168.1.25:5555
$ scrcpy
INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 0.6 MB/s (33622 bytes in 0.051s)
[server] INFO: Device: XXXXX XXXXXXX (Android 9)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.0 NVIDIA 390.25
INFO: Trilinear filtering enabled
INFO: Initial texture: 1440x2560
Make sure you are not connected to a VPN. I was able to connect to adb as soon as I disconnected from the VPN. For a sure way to connect do this:
adb kill-server
adb devices
This automatically starts the server. You sould see the device plugged in via USBadb shell ip addr show wlan0
to get your devices IP addressadb tcpip 5555
Set the port to 5555 that you want to connect throughadb connect 192.168.0.6:5555
Replace IP address with one from step 6.I solved this problem by disabling USB debugging and enabling it again
The critical step in getting this to work is disconnecting the usb cable after issuing the adb connect xx.x.x.xx:5555 command. At this point you are connected but unauthorized. Execute adb kill-server and re-issue the connect command. Verify with execution of adb shell date.