Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
113.66k stars 10.82k forks source link

Scrcpy mobile data #5283

Open toto6976 opened 2 months ago

toto6976 commented 2 months ago

Good evening, I use scrcpy and it works fine. But if I disconnect from WiFi and connect to mobile data, there is no way for me to access the phone. Is there a way to keep the connection available ?

rom1v commented 2 months ago

Your device IP (more precisely the adb server running on the device, typically on port 5555) must be reachable from your computer. This is unlikely to be possible on a mobile data network (and you don't want to access adb remotely over internet without ssh tunnel or vpn anyway, since it's unencrypted).

chacalau commented 2 months ago

you can turn on your phone hotspot and connect your computer to the hotspot then set scrcpy connect ip address to the gateway ip

toto6976 commented 2 months ago

Your device IP (more precisely the adb server running on the device, typically on port 5555) must be reachable from your computer. This is unlikely to be possible on a mobile data network (and you don't want to access adb remotely over internet without ssh tunnel or vpn anyway, since it's unencrypted).

no matter how I access the internet. Is there a way to keep the connection initialized with wifi when switching to 4g?

toto6976 commented 2 months ago

Good morning, I found this : https://github.com/ncdejito/scrcpy-ngrok/blob/main/run.sh Can you help me to make it work ?