scrcpy - Control Your Android Phone from Fatdog

Moderators: kirk, jamesbond, p310don, JakeSFR, step, Forum moderators

Post Reply
User avatar
p310don
Posts: 289
Joined: Tue Dec 03, 2019 7:17 am
Location: Brisbane, Australia
Has thanked: 55 times
Been thanked: 92 times

scrcpy - Control Your Android Phone from Fatdog

Post by p310don »

The nifty little program has been mentioned a few times lately on the forum, so thought I'd put some instructions here to help out anyone trying to do this.

SCRCPY (Screen Copy) is a screen mirroring application. It can work either via cable, or wirelessly.

scrcpy is in the Fatdog repository. Only recently added, so an update to gslapt is required. You'll also need ADB which is the Android Debug Bridge which can be downloaded from here:

https://developer.android.com/studio/re ... form-tools

Obviously for Fatdog (and other Puppies) download the Linux version. From there, extract the archive and copy the "adb" file from the "platform-tools" sub-directory to /usr/bin

You need to have debugging enabled on your Android device. Go to Settings > About Phone > and tap Build Number seven times. That should enable developer options.

Then connect your phone or other Android device via USB, type in

Code: Select all

scrcpy

in a terminal and you should see your phone's screen after accepting the adb confirmation.

That's the most basic thing. There are lots of options. I personally like wireless connection. Your phone and PC need to be on the same wireless network. If your phone's IP address is 192.168.1.5, then you'd use this code:

Code: Select all

scrcpy --tcpip=192.168.1.5

If you have a screen lock, simply type in the passcode and press enter to unlock your phone.

My preference is to connect to my phone without turning on the screen, so I use

Code: Select all

scrcpy --tcpip=192.168.1.5 --turn-screen-off --power-off-on-close

This connects to my phone without turning on the screen, lets me do what I need, and then locks it when I close the scrcpy window.

More info and options here:

https://github.com/Genymobile/scrcpy

and here:

https://developer.android.com/studio/command-line/adb

user1111

Re: scrcpy - Control Your Android Phone from Fatdog

Post by user1111 »

For wireless connections there maybe prerequisites (I believe subject to which version of Android/phone you're using) ...

https://developer.android.com/studio/co ... b#wireless

adb usually communicates with the device over USB, but you can also use adb over Wi-Fi. To connect a device running Android 10 or lower, there are some initial steps you must do over USB, as described below:

Connect your Android device and adb host computer to a common Wi-Fi network accessible to both. Beware that not all access points are suitable; you might need to use an access point whose firewall is configured properly to support adb.

If you are connecting to a Wear OS device, turn off Bluetooth on the phone that's paired with the device.

Connect the device to the host computer with a USB cable.
Set the target device to listen for a TCP/IP connection on port 5555.

adb tcpip 5555

Disconnect the USB cable from the target device.
Find the IP address of the Android device. For example, on a Nexus device, you can find the IP address at Settings > About tablet (or About phone) > Status > IP address. Or, on a Wear OS device, you can find the IP address at Settings > Wi-Fi Settings > Advanced > IP address.
Connect to the device by its IP address.

adb connect device_ip_address:5555

Thereafter scrcpy --tcpip=192.168.1.5 (or whatever IP for the phone) should work. At least that is the case for my oldish phone.

Post Reply

Return to “FatDog”