How to run scrcpy wirelessly (wifi network)?
Here are the steps:
- Connect the device to the same Wi-Fi as your computer
- Get your device IP address (in Settings → About phone → Status)
- Enable adb over TCP/IP on your device:
adb tcpip 5555
- Connect to your device:
adb connect DEVICE_IP:5555
(replaceDEVICE_IP
) - Unplug your device
- Run scrcpy as usual
To switch back to USB mode: adb usb
.
As expected, the performances are not the same as over USB.
The default scrcpy bit-rate is 8Mbps, which is probably too much for a Wi-Fi connection. Depending on the use case, decreasing the bit-rate and the resolution may be a good compromise:
scrcpy --bit-rate 2M --max-size 800
For people in a hurry:
scrcpy -b2M -m800
Note that while it now works over TCP/IP, this is not an optimal solution for streaming a video wirelessly, since the raw stream is still sent over TCP, where a packet loss is very bad for latency, due to head-of-line blocking. But it's better than nothing!
My testing
# Bat mode Wifi
adb tcpip 5555
# Connect thiet bi
adb connect DEVICE_IP:5555
adb connect 192.168.1.6:5555
scrcpy --video-bit-rate 2M
# tro ve mode USB
adb usb
---
1M
1000000
scrcpy --video-bit-rate 200000 --max-size=600 --always-on-top --disable-screensaver
ERROR: Multiple (2) ADB devices
ERROR: Multiple (2) ADB devices:
ERROR: --> (tcpip) 192.168.1.12:5555 device vivo_1920
ERROR: --> (tcpip) 192.168.1.6:5555 device ASUS_X00ID
ERROR: Select a device via -s (--serial), -d (--select-usb) or -e (--select-tcpip)
ERROR: Server connection failed
---
adb devices -l
scrcpy -s 192.168.1.6:5555
scrcpy -s 192.168.1.6:5555 --video-bit-rate 2M
Fix Android Studio wireless ADB error (10061)
No connection could be made because the target machine actively refused it. (10061)
- stay connect via USB
- connect to your WIFI network (computer and mobile device both)
- ping DeviceIP (must be have ping to your device)
adb kill-server
adb usb
adb tcpip 5555
- unplug usb cable (as per @captain_majid 's comment)
adb connect yourDeviceIP
adb devices
(must be see two device names , one of them is by deviceIP)- unplug USB cable