-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Ability to specify adb and scrcpy server Host/Port's #2801
Comments
Isn't the host necessary the same for adb and scrcpy? I would say yes, because the
Or even The remaining problem is the hardcoded localhost I guess. |
Yes the host would be the same, overlooked that :)
Yep confirmed that that env works, wasn't aware of that one before, thanks!
Seems like that may be the only blocker then 👍 |
OK, then I suggest to add an option Are you interested in working on it (from |
Honestly I suck at c/c++, and I haven't had much luck pulling this into an IDE to look at it. |
Yes, from Windows, open your browser, download a Linux ISO, put it on a USB key, install it. Then you are on Linux, and it's easy. More seriously, on Windows, you can build from MSYS2: https://github.com/Genymobile/scrcpy/blob/master/BUILD.md#in-msys2 |
Hm, So I'm looking at this and it seems to actually be getting stuck here Line 351 in 02ae0db
Aha.. another localhost Line 206 in 02ae0db
With both of these set to the server (from inet_addr, not sure if thats right) I don't seem to be getting far, might have to leave this to you |
Another question, does the port argument change where the adb tunnel exits or only where the connection is attempted, because that would need to still be the original port for my setup to work So the server would need to listen on 27183, and the client would need to connect to external 4444 |
This is intended to be the same address. The reason there are 2 is that once the tunnel is set up, scrcpy attempts to write to it (1038bad):
The
The server does not even listen on a TCP port, it listens to a unix socket, and (the |
so not exactly, the problem is currently that the port in each usb container will always be container 27183 -> phone socket I have dragged a friend into helping with this over at https://github.com/RipleyTom/scrcpy/tree/add_remote_options |
👍 Makes sense. Please open a PR (draft if it's not finished) to discuss more easily on each change if necessary. I suggest to rename the options |
In "adb forward" mode, by default, scrcpy connects to localhost:PORT, where PORT is the local port passed to "adb forward". This assumes that the tunnel is established on the local host with a local adb server (which is the common case). For advanced usage, add --tunnel-host and --tunnel-port to force the connection to a different destination. Fixes #2801 <#2801> PR #2807 <#2807> Signed-off-by: Romain Vimont <[email protected]>
Is your feature request related to a problem? Please describe.
I require a way to specify connection host and port for both adb and the scrcpy connection (assuming forward connection).
I have multiple android devices connected to one parent host, and each usb is isolated inside a docker container (similar to https://github.com/sorccu/docker-adb)
This results in both the adb port and the scrcpy server port being exposed to different ports on the host system.
Describe the solution you'd like
eg
scrcpy --adbHost 192.168.1.50 --adbPort 9999 --scrcpyHost 192.168.1.50 --scrcpyPort 10000 --force-adb-forward
Describe alternatives you've considered
Additional context
The client is not located on the same system as the devices, ssh forwarding is also not a good option due to these being isolated in their own containers.
The text was updated successfully, but these errors were encountered: