scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

SCRCPY wifi

Open Step72 opened this issue 1 year ago • 8 comments

Environment

  • OS: Mac Os 14.4.1
  • scrcpy version:
  • installation method: Terminal brew install scrcpy
  • device model: Redmi note 12
  • Android version: 14

Good morning I have a question regarding SCRCPY If I don't let SCRCPY connect via USB to my computer, when I start my computer in the morning, I have to reconnect SCRCPY via USB and redo the adb tcpip 5555 procedure to be able to use SCRCPY via WIFI

Is there a way when I start my computer that SCRCPY detects and works automatically over Wi-Fi

Step72 avatar Apr 20 '24 09:04 Step72

You must execute adb tcpip 5555 on every phone reboot. But not on computer reboot.

rom1v avatar Apr 20 '24 10:04 rom1v

Ok but my phone must always be connected to my computer!

Step72 avatar Apr 20 '24 10:04 Step72

If you don't want to connect over USB at all, as mentioned in the doc, from Android 11 you can pair wirelessly: https://developer.android.com/tools/adb#wireless-android11-command-line

rom1v avatar Apr 20 '24 11:04 rom1v

If I type in my terminal adb pair 192.168.1.16:5555 I don't receive any code association requests on my phone !

Step72 avatar Apr 20 '24 11:04 Step72

Did you enable wireless debugging?

Please follow the steps here, I cannot help more, it's the official Android documentation: https://developer.android.com/tools/adb#wireless-android11-command-line

rom1v avatar Apr 20 '24 11:04 rom1v

Good morning In the morning, when I start my computer, and I want to connect to SCRCPY directly via Wi-Fi, I have to each time in my terminal type adb connect 192.168.1.16:5555 THEN scrcpy -s 192.168.1.16:5555 to connect to my phone via wifi.

Why if I directly type scrcpy -s 192.168.1.16:5555 do I not connect via Wi-Fi to my phone?

Step72 avatar Apr 22 '24 09:04 Step72

scrcpy -s XXXX just selects a device listed by adb devices (like adb -s XXXX shell would do), it does not create any new connection.

So if your device is not connected, you must connect using adb connect XXXX beforehand (so that it is listed by adb devices).

But instead, you can use scrcpy --tcpip=192.168.1.16:5555 and it will connect if necessary. See https://github.com/Genymobile/scrcpy/blob/master/doc/connection.md#tcpip-wireless

rom1v avatar Apr 22 '24 09:04 rom1v

But instead, you can use scrcpy --tcpip=192.168.1.16:5555 and it will connect if necessary.

With this method it works really well. Thank you so much

Step72 avatar Apr 22 '24 09:04 Step72