Open madmax2615 opened 2 weeks ago
Once your device listens over TCP/IP, until the next device reboot, you can just adb connect xx.xx.xx.xx
and adb disconnect
as you want, without reconnecting USB.
(Note that adb server does not support 2 connected computers simultaneously though, so you must adb disconnect
on one computer before connecting from the other.)
For convenience, you can use scrcpy --tcpip=xx.xx.xx.xx
which performs the adb connect
for you.
https://github.com/Genymobile/scrcpy/blob/master/doc/connection.md#tcpip-wireless
I'm not sure if you understand what I'm trying to do.
I'm looking for a way to access only one(!) phone from two(!) computers (let's say, a desktop computer and a laptop). So actually, I have two(!) computer IP's, but only one(!) phone IP.
It doesn't have to be these two computers connected at the same time, but one or the other one alternately, but without the need of repeating the USB connection each time I'm moving to the other computer.
If it is not posssible yet, I would very much like to see such a feature in an upcoming version of scrcpy.
I'm looking for a way to access only one(!) phone from two(!) computers (let's say, a desktop computer and a laptop). So actually, I have two(!) computer IP's, but only one(!) phone IP.
Yes, exactly. My previous comment was for this situation. xx.xx.xx.xx
is the device IP.
Ok, thank you and sorry! So the misunderstanding was on my(!) side.
To clarify, basically, the first time, plug your device over USB, and run adb tcpip 5555
(or scrcpy --tcpip
).
Find the device IP (it is printed in the scrcpy logs with scrcpy --tcpip
).
Then unplug the device, and execute scrcpy --tcpip=xx.xx.xx.xx
from one computer.
Then adb disconnect
from the first computer to disconnect, then you can scrcpy --tcpip=xx.xx.xx.xx
from the other computer.
What about the adb key? I mean, when I'm on USB on the first computer, the phone wants me to confirm an adb key and at the same time, there are adbkey files being created on the computer (in the ~/.android folder).
Now, when I'm on the second computer using WiFi, will I have to confirm another adb key on the phone, or do I have to copy the ~/.android folder from the first computer to the second one, or is another ~/.android folder being created on the second computer with some different data?
Confirm another adb key.
I would like to be able to alternately connect two computers (both with MX Linux 23.4 xfce 64-bit) to the same phone (Galaxy S21 FE G5), depending on which computer I'm currently using. How can I do this, please?
So far, this is what I'm doing: Being on the first computer, I have to make a USB connection and then a WIFI connection. Then I go to the other computer and make one more USB connection and a WIFI connection.
But when I'm back on the first computer, scrcpy doesn't remember the first WIFI connection and therefore I have to make a new USB connection before I can go on with a WIFI connection.
What can I do to make a USB connection only once for both computers, and afterwards being able to only use WIFI connections, please?