Skip to content

Display and control your Android device

Force adb forward if tunnel host/port is provided

Romain Vimont68eaee5bb086
diff --git a/app/src/cli.c b/app/src/cli.c
index f00611a7..5256d50e 100644
--- a/app/src/cli.c
+++ b/app/src/cli.c
@@ -1405,6 +1405,12 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
}
#endif
+ if ((opts->tunnel_host || opts->tunnel_port) && !opts->force_adb_forward) {
+ LOGI("Tunnel host/port is set, "
+ "--force-adb-forward automatically enabled.");
+ opts->force_adb_forward = true;
+ }
+
int index = optind;
if (index < argc) {
LOGE("Unexpected additional argument: %s", argv[index]);