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

@@ -135,6 +135,8 @@ struct scrcpy_options {
bool downsize_on_error;
bool tcpip;
const char *tcpip_dst;
bool select_usb;
bool select_tcpip;
};
extern const struct scrcpy_options scrcpy_options_default;