-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Using scrcpy Wirelessly Not Working in Latest Build #386
Comments
Thank you for your report. I added some logs that should help investigating the issue. Could you checkout branch Compile the whole project (do not use the prebuilt server) in debug mode:
Then copy/paste the output in the console. Thank you for your help. |
NOW it works? Are you sure debugging is the only thing you changed? (Rhetorical, since I can read the commit) Thanks for all the help. Strange it's not working for me on the main build, considering it's also v1.5. Can we just make the debugging an argument? I think we need the option to be included in the main build, considering how useful it would be. It would help me figure out why it's not working in the main build, and why it keeps crashing when I use USB mode. |
Give me a few minutes to build and test each one.
Yeah, I thought you would assume I meant a runtime argument. I think there need to be varying levels of details for the runtime debugging flags, just so people don't have to sift through all the logs, if verbose is too much. |
Okay, both builds you asked about work for me. However, I don't think this is a valid test, since I received the same debugger messages as your debugger build. I ran from the builds themselves ( |
Use a separate build directory in release mode:
|
Alright, that looks more like it. |
Now working for me. Only output
No window opened the |
What does |
It should not. What is the result of |
Maybe my fault. I try to write a adb-usb to tcp proxy. some code may not working. |
I debug for a long time, but still do not know why. Here is my tool which can share usb device over WIFI. https://github.com/codeskyblue/fa
In another pc $ adb connect 10.0.0.1
$ scrcpy -s 10.0.0.1:5555
/usr/local/Cellar/scrcpy/1....B/s (18570 bytes in 0.011s)
error: reverse service not supported
2019-01-13 13:14:17.471 scrcpy[55728:3248464] ERROR: "adb reverse" returned with value 1
2019-01-13 13:14:17.471 scrcpy[55728:3248464] WARN: 'adbreverse' failed, fallback to 'adb forward'
2019-01-13 13:14:17.662 scrcpy[55728:3248464] ERROR: Could not retrieve device information I don't know why it prints Hope to hear from you soon. @rom1v |
On start, scrcpy client opens a socket (on port 27183) to communicate with the server (executed on the device). If this fails, the reason is probably that the socket is not connected between the client and the server. In "forward" mode, the client connects to Typically, if you use your own tunnel, #144 (comment) |
I'm pretty sure adb forward works fine. Another similar tool https://www.vysor.io/ works fine. I traced command executed in tunnel. When call app_process, trace dumped. Aborted $ adb push /usr/local/share/scrcpy/scrcpy-server.jar /data/local/tmp
$ adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 0 8000000 true
Aborted |
Are there any relevant logs in Does it work over usb? Is Android >= 5.0? |
I installed scrcpy through There is no relevent log in
Yes it works over usb. And If you use |
Finally find out the problem. When run this command
Another command calls in another thread.
So app_process can not found scrcpy-server.jar, One solution to solve this problem is to delay 1 second, and then call |
Looks like relevent with #390 |
@codeskyblue The client removes the file as soon as it is connected with the server: The problem with an additional tunnel is that from the client point of view, the connection will succeed as soon as it is connected to the tunnel, even if the server is not started yet, so it will remove the server before even starting it. Here, even if we don't remove the server, this is still racy: any Currently, I have no race-free solution. I started a background thread in my mind to think about it. 😉 |
Maybe you can retry connect when fails? |
And I found if you start the jar server already, scrcpy can works fine all the time. |
To clean up the device, the client executed "adb shell rm" once the server was guaranteed to be started (after the connection succeeded). This implied to track whether the installation state, and failed if an additional tunnel was used in "forward" mode: <#386 (comment)> Instead, make the server unlink itself on start.
@codeskyblue I have no idea why I cleaned up the device from the client. On |
Sorry @rom1v even you don't delete jar file it is still say Aborted. I think maybe when app_process called, maybe the first connect may fail because of server is still starting |
And I don't think it is a good idea to unlink in jar. It will make it hard to debug issues. |
In "forward" mode, it retries if it fails. Oh, what I said here is incorrect: the problem of connect-without-read when a tunnel is present is already managed: 1038bad. You should try to increase the number of connection attempts. EDIT: In fact, it can't be the cause of an Abort.
The purpose is to leave nothing on the device once disconnected. It's trivial to comment |
Oh. So it's not related. Is the file correctly copied? |
yes the file is correctly copied |
Idk if your issue has anything to do with mine, but I just recently closed my issue with steps on how to fix. |
For the record, it has never actually worked for me, wirelessly. I can get it to work with wired adb, but not wirelessly.
Full issue described here.
Basically, I always get the "connection rejected" error, no matter what I try.
So, I was requested to open an issue here. I have seen many posts like this, already, however, and they each seem to end up getting closed despite no resolution.
The text was updated successfully, but these errors were encountered: