How to Install Scrcpy (2.3 Updated) in Debian 12 / Ubuntu 22.04

This is a step by step beginner’s guide shows how to install the latest Scrcpy package in Debian 12, Ubuntu 22.04 and Ubuntu 23.10.

Scrcpy is a popular free and open-source software to mirror and control Android screen on PC/laptop. The latest version so far has reached v2.1 with exciting features such as audio support, audio only mode, and use Android as microphone.

However, Scrcpy package in Debian and Ubuntu repositories somehow stuck at v1.25. So, I’m here to show you how to install the latest release for the great new features.

Step 1: Install the dependencies

The project has an official guide for installing the software in Linux. Here is a re-write with screenshots and more descriptions to help beginners understand the process.

First, search for and open a ‘terminal’ window either from start/application menu or ‘Activities’ overview depends on your desktop environment.

When terminal opens, paste the command below and hit Enter to install required dependency packages for building and/or running Scrcpy:

sudo apt install ffmpeg libsdl2-2.0-0 adb wget gcc pkg-config meson libsdl2-dev libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev libswresample-dev libusb-1.0-0 libusb-1.0-0-dev

Type user password when it asks, though there’s no asterisk feedback, and hit Enter.

Step 2: Download & Install Scrcpy

Now, download the source code for the latest version from its github releases page under ‘Assets’ section:

Once you got the source tarball, extract it! Then, right-click on extracted folder and select “Open in Terminal“:

When terminal opens with the source folder as working directory, run the script to build and install Scrcpy:

./install_release.sh

NOTE1: The command may also ask you to type user password, for permission to install Scrcpy to ‘/usr/local/bin‘ directory!

NOTE2: The “install_release.sh” script MAY sometimes installing WRONG server version, causing “The server version (x.xx) does not match the client (x.xx)” error. In the case, edit the script file manually, change the version number of “PREBUILT_SERVER_URL”, and replace the value of PREBUILT_SERVER_SHA256 according to the one in Github download page.

When the command is done successfully, you should see something that it installed the app, server, icons, .desktop shortcut files to their destination directories. Just like the screenshot below shows:

Step 3: Start Scrcpy

Once installed the application, you can start it either from system application launcher.

Or by running scrcpy command with your desired options.

However, to successfully run Scrcpy, you need to first connect your Android device (enable USB debugging first), and start adb daemon. Here’s another step by step tutorial show how to use Scrcpy to mirror your Android screen on PC.

Uninstall:

To uninstall the software, also right-click on source folder and select ‘Open in Terminal’. Then, run the uninstall script from source:

sudo ninja -Cbuild-auto uninstall

If you’ve already removed the source folder, run the commands below one by one to manually remove all the installed files:

sudo rm /usr/local/bin/scrcpy
sudo rm /usr/local/share/scrcpy/scrcpy-server
sudo rm /usr/local/share/man/man1/scrcpy.1
sudo rm /usr/local/share/icons/hicolor/256x256/apps/scrcpy.png
sudo rm /usr/local/share/zsh/site-functions/_scrcpy
sudo rm /usr/local/share/bash-completion/completions/scrcpy
sudo rm /usr/local/share/applications/scrcpy.desktop
sudo rm /usr/local/share/applications/scrcpy-console.desktop

Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.