I’m sure you’ve heard about Scrcpy! it’s a pretty nice tool that allows you to display and control an Android devices from your PC either usb or TCP/IP, hence on this post I will explained how to set up Scrcpy in Fedora 33 by using copr repo. It’s really useful, and believe me if I told you that; from one of my last job, one of my colleagues got the idea to install it, and thanks to that the dev team saved a lot of time testing a app integration remotely.

NOTE: Copr is not yet officially supported by Fedora Infrastructure.

  1. Enables the copr repo
$ sudo dnf copr enable zeno/scrcpy
  1. Then install the scrcpy
$ sudo dnf install scrcpy

Below are the dependencies:

  • SDL 2.0.12
  • libavcodec 58.91.100
  • libavformat 58.45.100
  • libavutil 56.51.100

More below, if you will needed them,

$ sudo dnf install android-tools ffmpeg SDL2-devel ffms2-devel meson

On this step we have already Scrcpy installed, lets have a look, connects your android device by usb on your desktop, open a terminal and issue Scrcpy

$ Scrcpy

You should see the window popping up with the Android device’s screen on your desktop.

If you have more than ones connected, you can use the s flag and select it by its ID

$ scrcpy -s <ID>

Troubleshooting:

Useful command that shows you if your android device is connected and opened.

$ adb devices
$ lsusb

If you get a thread exception, error output below:

INFO: scrcpy 1.19 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 164.7 MB/s (37330 bytes in 0.000s)
[server] INFO: Device: Gigaset GS290 (Android 10)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 21.1.8
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x2336
WARN: Device disconnected
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalStateException
	at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
	at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2792)
	at com.genymobile.scrcpy.ScreenEncoder.encode(ScreenEncoder.java:114)
	at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:95)
	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:61)
	at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
	at com.genymobile.scrcpy.Server.main(Server.java:255)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:340)

I could found the solution by the following git bug issue here

Some adb commands:

$ adb devices
$ adb kill-server
$ adb start-server
$ adb --help

Remember:

  • Enable the Android Debug Bridge(ADB) from your Android device.

Thanks to the information found here