-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Connection is rejected after unplugging the device from computer #842
Comments
Indeed, on some devices, disconnecting the USB cable breaks the adb-over-tcp connection. There are several threads about this on stackoverflow, but no real solution AFAIK. |
I can confirm this issue is still present on v1.12.
For those who're wondering, I have no port-managing app on my phone nor any Firewall. |
The issue is independant from scrcpy, it's just https://stackoverflow.com/questions/33462720/adb-unable-to-connect-to-192-168-1-105555 |
Hi, Were you able to fix that issue? The same happens to me. Once I restart my computer or the phone, I'm forced to connect Phone via USB and then enable adb over TCP everytime. |
Hello. I'm in the dark and out of ideas. |
Hi, Thanks for the quick response. Looks like it automatically disables the adb tcp connection after sometime of idle, something similar the "remember me" cookies on websites. I hope that's not the case though. |
I'll have a look into that once I get back home. |
Sure, keep us posted at your convenience. Thanks. |
@rdlf4 [Possible Solution]Enable Allow ADB Debugging in charge only mode as shown in the picture attached. Hopefully this helps. If this is indeed the problem, we will need to update the setup instructions for scrcpy wireless connection in the |
If that's the problem, yes, you could submit a new entry in FAQ.md 👍 |
@cardboardcode Thanks for taking the time to look into this. Question is, where do I go from here? :/ |
@rdlf4 Since I am not an expert on this issue, I can only recommend a crude workaround or generic advice:
@rom1v |
I was successful in getting a connection after following these steps. |
@NLHybrid @cardboardcode @rdlf4 this trick with enabling "Allow ADB debug in charge only mode" has helped me too! Thanks! Someone should add this to the Readme.md |
To permanently enable adb via wifi that will persist upon reboot, login as root in termux and issue command:
In case things go really bad and adbd crashes (but shouldn't be the case normally), you can restart it in termux using root with:
No need to plug usb cable anymore afterwards. |
I've never heard of "setprob". Should there be a space between the two words? EDIT #3: I seem to have found a fix. EDIT #4: Issuing those commands as sudo makes no difference EDIT #5: I tried restarting the phone since those commands are supposed to 'persist', so maybe they would show some result after it restarts. No, it doesn't. |
@rdlf4 yes you can pass the command with adb shell. What I wrote above was directly into android's shell (via termux app) To do that, you need however to become root to modify system props. So use this instead:
Update: now i read your edits. Do you get any error? |
I couldn't become root (SU) when using Termux, which seems to require my phone to be rooted. Lots of work related stuff on there to even think about it, so I'm avoiding rooting my phone for now. |
su implies having root access. You will make your life easier if you root your phone than trying to mess around with props in other ways. My advice for rooting is magisk. Depending on the android version you might need to follow a different approach. xda forums is a good place to start. edit: i think you could however install custom recovery (TWRP) , mount system as read-write and modify build.props from there. No root needed. Worth a try.. What android version do you have? |
I created this tool to ease wireless connectivity. Check it out and let me know of your experience. |
So, this has happened to me all the time I need to recharge my phone, and I do so by plugging it to my computer. But normally, after it's been charged and unplugged, trying to connect to my phone again via wireless by issuing the command
returns me with an error:
Then, I have to plug it to my computer again, do the same as I did before:
And then, do:
So that, my phone returns:
And then, it finally connects.
My question is, why is it that every time I unplug it from my computer, it no longer works in TCP mode? Can't I leave it like that, in order to not have to re-do those steps after unplugging my device?
The text was updated successfully, but these errors were encountered: