Scrcpy on openSUSE | Display and Control Android devices over USB

Every once in a while, I am in the position where I am tethering my computer to my phone and lazy me doesn’t like to interface with the phone when my fingers are on a real keyboard. I can’t say exactly why I am so anti-mobile at times but it’s just how it is sometimes.

I was introduced to this application called Scrcpy which I think look like “screen copy” so that is how I verbally communicate it.

Installation

To install from the openSUSE software library, I navigated to openSUSE’s software site.

https://software.opensuse.org/package/scrcpy

I chose the Experimental Repository, Hardware

Alternatively, you can install the Snap package

sudo snap install scrcpy

Whatever works best for you. I have tried both on openSUSE Tumbleweed and they both work well.

Changes to the phone

The Android device you intend on using requires at least API 21 (Android 5.0) in order to utilize this feature.

Make sure you enabled adb debugging on your device. This is done by going into your Settings > System > About Phone then scroll down to the “Build Number” section and tap that until you are in “Enable Developer Settings”.

Back out of the About Phone menu and enter the { } Developer options menu.

Scroll down to the Debugging section and enable Android debugging. This will allow you access the ADB bridge interface from your computer. I do want to make it clear that at this point, it is not a good idea to just plug your device in anywhere. You had better know that USB port and trust it. Random public chargers are probably not a good idea unless you trust the custodian of it.

Optionally, you can enable the ADB over network where you can debug over Wi-Fi or USB networks. Unless you are on a trusted network, this is also not a good idea. For example, I would not recommend this on a public hotel or coffee shop Wi-Fi but home is a good bet. The neat thing about this option is that you can interface with your device and not be physically plugged into it.

Now the phone is set up and ready to have the display piped over to your desktop.

Run

Running requires you to go into the terminal as well. Plug the Android device into your openSUSE (or other) machine’s free USB port. You will be given a screen, similar to this:

I have selected to “Always allow” from my computer. Select OK and run the this in terminal:

scrcpy

And that is all there is to it. You can now interact with your phone through your computer. Interestingly, Plasma disabled compositing when I initiated the scrcpy command. It could easily be reactivated (Shift+Alt+F12) and it didn’t seem to affect performance of the window into the device.

Wireless Connection

Scrcpy has the capacity to do adb over TCP/IP. This can be activated by going into Settings > System > Developer Options scroll down to “Debugging” and Enable ADB over Network.

You will be given a warning which you have seen previously and will be given an IP with a port number. In this case, I the IP and Port numbers are: 172.20.2.250:5555

Next, ensure your device is not plugged into your computer, just to prove to yourself it is working over the magical Wi-Fi. Next, enable TCP/IP on your computer:

adb tcpip 5555

Connect to your device

adb connect DEVICE_IP:5555

Where DEVICE_IP is the IP Address of the mobile device. Then run just as previously run:

scrcpy

It is also possible to adjust your bit-rate in the definition if you see fit. An example of usage is here.

scrcpy --bit-rate 2M --max-size 800

This is just scratching the surface of what you can do with Scrcpy. It is pretty useful and an alternative, to input and interact with your phone. Since I am not a fan of interacting directly with the phone. There are numerous other features you can read about here from the project GitHub. This is just enough to get you started.

Final Thoughts

If nothing else, this is a fun application to play with, even for the novelty factor. These are only just a few highlights of this really cool application. What are the use cases for this? I can see many, really. I am not a huge fan of the phone interface. I prefer typing on a real keyboard. I have a tendency to leave my phone in another room on a charger. With Scrcpy, I am able to check mobile apps only from my computer as opposed to directly handling the phone. Another use case would be to record the screen for the purpose of a pre-recorded demonstration or in a classroom environment, demonstrate the function of an application projected from the computer hooked into a projector. The limitations of this application is bound by the limitations of your own imagination.

References

Scrcpy Project on GitHub
Scrcpy from software.opensuse.org
Scrcpy from Snap Store

One thought on “Scrcpy on openSUSE | Display and Control Android devices over USB

Leave a Reply