Install & Set up “Scrcpy” Android Remote Control App in Ubuntu

Last updated: September 18, 2024 — 6 Comments

This is a step by step guide shows how to install and use Scrcpy, the Android screen mirroring and remote control application, in Ubuntu desktop.

Scrcpy, pronounced “screen copy“, is a popular free open-source application works on Linux, Windows, and macOS. With it, user can mirror Android screen on computer desktop and control it with mouse, keyboard, and/or gamepad.

The Android device is connected either wired with USB cable or wirelessly through TCP/IP network protocol. Nothing needs to be installed on Android, as it uses >b<Android Debug Bridge (ADB) to implement the core features.

Besides mirroring Android screen on your desktop, it also features:

  • Audio mirroring or forwarding (Android 11+).
  • Screen recording.
  • Copy and paste in both directions.
  • Mirroring with Android screen off.
  • Camera mirroring.
  • OTG mode, that only run physical keyboard, mouse and gamepad simulation, as if the computer keyboard, mouse and gamepads were plugged directly to the Android device.


NOTE: This tutorial is tested and works in Ubuntu 22.04/Ubuntu 24.04, though it should also work in all current Ubuntu releases.

Step 1. Prepare your Android device

To use the software, you need to first enable USB Debugging Mode in Android, unless you need to run only in OGT mode.

1. First, go to Settings in Android. Navigate to “About Phone”, and tap on “Build Number” several times (usually 7 times). It should prompt you something like “You are now in Developer Mode“.

NOTE: there’s NO security issue or performance loss with developer mode enabled.

2. Then navigate to “Developer Options” in Settings menu or ‘Additional Settings’ sub-menu, and turn on the option for “USB Debugging“.

Step 2. Install adb

adb (Android Debug Bridge) package is also required for this software. Just press Ctrl+Alt+T on keyboard to open terminal and run command to install it:

sudo apt install adb

Step 3. Install scrcpy

Scrcpy is available in Ubuntu Software (or App Center) through native .deb and snap packages. However, both are outdated!

For the latest version, it’s recommended to use the official install guide by doing the steps one by one below.

1. First, press Ctrl+Alt+T to open up a terminal window. When it opens, run command to install dependency libraries:

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

2. Then, clone the source code via command:

git clone https://github.com/Genymobile/scrcpy


3. Finally, navigate to source folder and run the installer script  from that folder to install scrcpy:

cd scrcpy && ./install_release.sh

NOTE: During building process it may ask you to type user password for the permission to install files into system directories.

Step 4. Remote control your Android in Ubuntu

Now, connect your Android device into Ubuntu using USB cable. Then, click “Allow” in Android to confirm the “Allow USB Debugging” dialog.

1. First, open terminal (Ctrl+Alt+T) and start adb in your favorite mode:

  • To remote access via USB cable, run command:
    adb usb
  • To remote access using wireless network, run commands:
    adb tcpip 7676
    adb connect 192.168.0.150:7676

    Here, change port number 7676 and the Android’s IP address accordingly! When done successfully, you can then remove the USB cable.

2. If the previous steps go well without any error! You can now start scrcpy by searching from either start menu or GNOME overview depends on your desktop environment.

Scrcpy includes many optional features that are NOT enabled by default. You may start it from terminal window with custom options. For example, play audio on both Android and computer sides:

scrcpy --audio-source=playback --audio-dup

That’s it. Your android screen should appear in the Ubuntu desktop after launching scrcpy. For more options, either run man scrcpy in terminal or see the official project page.

Uninstall scrcpy

To remove the adb package, open terminal and run command:

sudo apt remove --autoremove adb

To remove scrcpy, navigate to the source folder again in terminal window and run command to uninstall it:

sudo ninja -Cbuild-auto uninstall

If you’ve already removed the source folder you cloned in Step 3, then you may manually delete the scrcpy files by running command:

sudo rm /usr/local/bin/scrcpy
sudo rm -R /usr/local/share/scrcpy
sudo rm /usr/local/share/applications/scrcpy*.desktop

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

6 responses to Install & Set up “Scrcpy” Android Remote Control App in Ubuntu

  1. Thanks for installation instructions!
    I can connect my phone, play a video, and see the video on my desktop. But have no audio.
    Would you know if and how to cast the audio?
    thanks.

  2. Will this work if the phone is on a different network than the PC? Also, assuming I can get the connection working, can I start and use CHROME through the PC?
    Thanks

  3. Hello,

    scrpcy seems not to be working on Linux Mint 22 (Ubuntu 24.04) when I upgraded from Mint 21.3.
    It keeps complaining:
    scrcpy: error while loading shared libraries: libavformat.so.58: cannot open shared object file: No such file or directory
    Installing livavformat58 does not work (not available)
    Installing dependency libraries do not work either.
    Do you have any suggestions?

    • If scrpcy was installed before the process upgrading from Mint 21.3 to 22. Then, try re-installing scrpcy, since the dependency libraries changed in different Mint releases.

  4. hi dev, i cant see scrcpy ( console ) anywhere

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

*