Connect your device through usb and enable adb over TCP/IP:
adb tcpip 5555
- Connect the device to the same Wi-Fi as your computer
- Get your device IP address (in Settings → About phone → Status)
- Connect to your device:
adb connect DEVICE_IP:5555
- Run
scrcpy
To switch back to USB mode: adb usb
.