Control your Android smartphone from your desktop
Remote Control
With guiscrcpy graphical user interface and the scrcpy command-line tool, you can control your smartphone from the comfort of your Linux desktop and even record what you're doing onscreen.
Smartphones and the Linux desktop complement each other quite well thanks to cloud services. If you're not afraid of Google services or providers like Dropbox, WhatsApp, and the like, you never again have to connect your mobile phone to your computer to synchronize data or copy photos and videos. Even messengers like WhatsApp or Google's Messages now offer a web interface so that your mobile phone can stay in your pocket.
However, there are also situations in which you might want to be able to use your PC to operate your mobile phone. Ideally, you would want to transfer the content of the mobile phone display to the PC desktop. This is exactly what the duo of the scrcpy
command-line program and the guiscrcpy graphical user interface (GUI) offers. These open source programs available for Linux, macOS X, and Windows even let you record what is happening on the mobile phone display.
Screen Copy
scrcpy
comes from the Genymobile [1] treasure trove. Among other things, Genymobile specializes in virtualizing Android, which means that developers can test their applications on a variety of smartphones or tablets without having to own the devices themselves. As a command-line tool, Genymotion provides the scrcpy
[2] program's source code on GitHub for download under the very liberal Apache license.
Developed independently of scrcpy
, the guiscrcpy GUI [3] adds some convenience. The program integrates all the scrcpy
functions and lets users open the connection with a single click. Freely placeable toolbars with buttons on the desktop help to transmit typical actions, such as the Home, Back, and Menu buttons, as well as, for example, rotating the smartphone's display.
Installation
Both guiscrcpy and scrcpy
are still so new that they are not available in the major distributions' package sources. Only Arch Linux allows you to install the two programs from the Arch User Repository (AUR). Listing 1 shows you how to import guiscrcpy from the AUR; alternatively you can use another AUR helper or graphical package manager like Manjaro's Pamac. When installing from the AUR, the system automatically fetches scrcpy
and the other dependencies to your machine.
Listing 1
Importing from the AUR
For other distributions (like Ubuntu 19.04, which we use in our lab), the developer offers precompiled binary packages together with an installation script. To install, download the current version (1.10.1 when this issue went to press) in the form of a tar.gz
archive, unpack the file as shown in Listing 2, and execute the installation script. It saves the program as guiscrcpy
and also creates an entry in the Application menu. (To uninstall guiscrcpy, see the "Deinstallation" box.)
Listing 2
Installing guiscrcpy
Deinstallation
Guiscrcpy's developer currently provides an installation script, but there is no option to delete the program from the system. Use the commands from Listing 3 to remove the application and the configuration file from the home directory, if needed.
Listing 3
Removing guiscrcpy
Guiscrcpy functions as the interface for the scrcpy
command-line tool. scrcpy
is also missing from popular distributions' package sources, but the developers do offer the program as a Snap package [4] – many distributions now support this format out the box. On Ubuntu 19.04, you can import the tool with Snapcraft using a single command. In the same step, you also install the Android Debug Bridge (adb
) via the Android Software Development Kit provided by Google (Listing 4).
Listing 4
Installing scrcpy and adb
Developer Mode
For guiscrcpy to access your smartphone, developer mode and USB debugging must be enabled on the mobile device. Google has hidden the settings you need for this. To unlock them, open Settings on your smartphone, then in General | About Phone | Software Information tap the Build Number seven times. Depending on the smartphone manufacturer, the menu path may vary.
You now should find a new Developer Options menu item in the settings, where you can enable both the developer options en bloc and USB Debugging as an additional option (Figure 1). Later, the smartphone will ask you if you want to allow USB debugging when you connect via guiscrcpy for the first time. You can use a fingerprint to identify the connected computer later on and save the connection using the Always allow from this computer option.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.