Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making scrcpy choose between what connection to use #5720

Open
Toxic7120 opened this issue Dec 30, 2024 · 3 comments
Open

making scrcpy choose between what connection to use #5720

Toxic7120 opened this issue Dec 30, 2024 · 3 comments

Comments

@Toxic7120
Copy link

is there a way i can make scrcpy choose a connection like if it sees just TCIP, use that as connection or when it sees both TCIP and USB, prefer USB? or do i have to specify what connection to use on my shortcut. (yes i can make 2 shortcuts but i just want one icon)

@rom1v
Copy link
Collaborator

rom1v commented Dec 30, 2024

@Toxic7120
Copy link
Author

https://github.com/Genymobile/scrcpy/blob/master/doc/connection.md#selection

From what I understand, there's only options to choose one. I'm talking about being able to use a specific one when 2 are detected but use the only available when only one is.
Example:
When I don't connect my phone using USB, it uses tcpip as it's the only thing that it finds.
But when I connect my USB and it sees both USB and tcpip, it chooses the USB. Using the argument -d in the shortcut doesn't let me use tcpip when the device isn't connected through USB.

@rom1v
Copy link
Collaborator

rom1v commented Dec 31, 2024

Scrcpy has no such fallback selection mechanism.

As a workaround, in bash, you could execute with -d, and if exit code is 1, then execute without -d (or with -e):

scrcpy -d
[[ $? == 1 ]] && scrcpy

(not tested, I'm on my phone)

You can do the same in a .bat for Windows, but I don't know how (you could ask ChatGPT).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants