How to run scrcpy wirelessly (wifi network)?

Table of Contents

How to run scrcpy wirelessly (wifi network)?

Here are the steps:

  1. Connect the device to the same Wi-Fi as your computer
  2. Get your device IP address (in Settings → About phone → Status)
  3. Enable adb over TCP/IP on your device: adb tcpip 5555
  4. Connect to your device: adb connect DEVICE_IP:5555 (replace DEVICE_IP)
  5. Unplug your device
  6. 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)

  1. stay connect via USB
  2. connect to your WIFI network (computer and mobile device both)
  3. ping DeviceIP (must be have ping to your device)
  4. adb kill-server
  5. adb usb
  6. adb tcpip 5555
    1. unplug usb cable (as per @captain_majid 's comment)
  7. adb connect yourDeviceIP
  8. adb devices (must be see two device names , one of them is by deviceIP)
  9. unplug USB cable

Leave a Reply

Your email address will not be published. Required fields are marked *