Currently, the client listens on port 27183 until the device is connected. The port can be customized by -p/--port option: scrcpy -p 1234.
However, if we start 2 devices at the same time, one of them will try to listen on the same port of the other, and fail with bind: Address already in use.
To avoid this annoyance, -p/--port should accept a range:
scrcpy -p 27183:27186
scrcpy -p 27183 # implicitly 27183:27183
On connection, it iterates over the range until it can bind a port.
The default value could be something like 27183:27200, so that in practice starting scrcpy for several devices simultaneously always work.
See #945.
Currently, the client listens on port
27183until the device is connected. The port can be customized by-p/--portoption:scrcpy -p 1234.However, if we start 2 devices at the same time, one of them will try to listen on the same port of the other, and fail with
bind: Address already in use.To avoid this annoyance,
-p/--portshould accept a range:scrcpy -p 27183:27186 scrcpy -p 27183 # implicitly 27183:27183On connection, it iterates over the range until it can bind a port.
The default value could be something like
27183:27200, so that in practice starting scrcpy for several devices simultaneously always work.See #945.