Add option to select USB or TCP/IP devices

If several devices are connected (as listed by `adb devices`), it was
necessary to provide the explicit serial via -s/--serial.

If only one device is connected via USB (respectively, via TCP/IP), it
might be convenient to select it automatically. For this purpose, two
new options are introduced:
 - -d/--select-usb: select the single device connected over USB
 - -e/--select-tcpip: select the single device connected over TCP/IP

PR #3005 <https://github.com/Genymobile/scrcpy/pull/3005>
This commit is contained in:
Romain Vimont
2022-02-06 18:40:18 +01:00
parent 146f65d7b2
commit 582161607e
9 changed files with 79 additions and 3 deletions

View File

@@ -297,6 +297,8 @@ scrcpy(struct scrcpy_options *options) {
struct sc_server_params params = {
.req_serial = options->serial,
.select_usb = options->select_usb,
.select_tcpip = options->select_tcpip,
.log_level = options->log_level,
.crop = options->crop,
.port_range = options->port_range,