-
-
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
Add --tcpip option to automate TCP/IP (wireless) connections #2827
Conversation
0fa96eb
to
8429e43
Compare
@rom1v I have a Huawei mobile phone and a Xiaomi mobile phone, I did a test separately, scrcpy --tcpip=192.168.1.1 # default port is 5555 |
Huawei mobile phone obtains IP log:
Xiaomi mobile phone obtains IP log:
Both mobile phones are connected to the Wi-Fi network at the same time. The difference is that the phone card is not inserted in the Huawei mobile phone, and the phone card is inserted in the Xiaomi mobile phone. I think you should start with the analysis of keywords in dev wlan0 proto kernel scope link src. |
OK, thank you for your test. For now, it always retrieves the ip from the first line of |
I pushed a new version, please re-test 😉 |
@rom1v I tested it on Xiaomi and Huawei devices respectively, and --tcpip work well. |
Expose an option to automatically configure and reconnect the device over TCP/IP, to simplify wireless connection without using adb explicitly. There are two variants: - If a destination address is provided, then scrcpy connects to this address before starting. The device must listen on the given TCP port (default is 5555). - If no destination address is provided, then scrcpy attempts to find the IP address of the current device (typically connected over USB), enables TCP/IP mode, then connects to this address before starting. PR #2827 <#2827>
Add an option to configure the TCP/IP connection automatically. There are two variants.
If the device (accessible at 192.168.1.1 in this example) already listens on a port (typically 5555) for incoming adb connections, then run:
scrcpy --tcpip=192.168.1.1 # default port is 5555 scrcpy --tcpip=192.168.1.1:5555
If the device TCP/IP mode is disabled (or if you don't know the IP address), connect the device over USB, then run:
scrcpy --tcpip # without arguments
It will automatically find the device IP address (by parsing
adb shell ip route
), enable TCP/IP mode, then connects to the device before starting.This feature is available in scrcpy v1.21.
obsolete
Here are binaries so that you can test easily. Please replace these files in your v1.20 release:
scrcpy.exe
sha256:c3d96408d81d4c3f17259a8d99bd2e343f6c9758dc85e6317b114f6cdc95fd00scrcpy-server
sha256:e08e9aa4796c213bf601f6323b5e9f4fce250b1f3b1d46441289824cb4af294aold binaries v3
scrcpy.exe
sha256:67068f06190a5454ca245290022da84549a8d23c5c90926ddf2a558a20e2d0f8scrcpy-server
sha256:e08e9aa4796c213bf601f6323b5e9f4fce250b1f3b1d46441289824cb4af294aold binaries v2
scrcpy.exe
sha256:1931c1637fb35c453d35b416cc0bcbefcf25806f79d52eb3cec3d5fc78a26a05scrcpy-server
sha256:e08e9aa4796c213bf601f6323b5e9f4fce250b1f3b1d46441289824cb4af294aold binaries v1
scrcpy.exe
sha256:e77f3140f90353ad5b724576df9f1223717c24927ea4255714c122d5a956451ascrcpy-server
sha256:e08e9aa4796c213bf601f6323b5e9f4fce250b1f3b1d46441289824cb4af294aPlease test and report any issue you might encounter. This is also built from the current
dev
branch (so with code which will be in the next release), where I did a lot of refactors recently, so please report any regression. That would help a lot 😉Thank you for your feedback.