Skip to content

Commit

Permalink
Force adb forward if tunnel host/port is provided
Browse files Browse the repository at this point in the history
Tunnel host and port are only meaningful in "adb forward" mode.

They indicate where the client must connect to communicate with the
server. In "adb reverse" mode, the client _listens_, it does not
_connect_.

Refs #2807 <#2807>
  • Loading branch information
rom1v committed Nov 19, 2021
1 parent 46f7cd3 commit 64400c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 64400c8

Please sign in to comment.