1. Programs

Mirror Your Android Device Inside your PC with Scrcpy

.

Scrcpy is an open source program that allows you to mirror your android device as a standalone window inside your desktop operating system such as Windows, macOS and Linux. You’ll be able to view your android device interface from that window, and control all activities and run any type of applications/tasks you want from there, just as if you were running it on your phone itself.

1 scrcpy
Scrcpy Running on Ubuntu 20.04 Desktop

It is a great tool if you continuously need to check your android phone, and it is totally free and open source. You can minimize the window and restore it back whenever you need to check something from your phone.

A new version of Scrcpy was released few days ago, so we’ve decided to put our hands on it and see what an average android user can expect from it. We’ll review scrcpy and examine its features.

Scrcpy Installation

Scrcpy works with any android phone version +5.0. You may also need to enable USB debugging from the settings of your phone before you can use Scrcpy.

For Windows, you can download the latest version from the following link. For Ubuntu, you may install it using the Snap package:

snap install scrcpy

For Fedora:

sudo dnf copr enable zeno/scrcpy
sudo dnf install scrcpy

For macOS, install it from Homebrew:

brew install scrcpy

After you have installed the program, and enabled USB debugging on your phone, you should now connect your phone to your PC using a USB cable. Then, launch scrcpy either from its application icon, or from the command line via simply typing:

scrcpy

If an error message like this appears:

[email protected]:~$ scrcpy
INFO: scrcpy 1.15.1 https://github.com/Genymobile/scrcpy
adb: error: failed to get feature set: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
ERROR: "adb push" returned with value 1

Then accept the confirmation message on your phone like the following:

3 scrcpy

And then restart Scrcpy, and the window should appear on your desktop.

Controlling Android from your PC

At first, you may need to wake up your phone from the lock screen using the right-click mouse button (Which is also used as the Return button on the android view). Then you can use your mouse and keyboard to control your phone. Long press in the left-click mouse button to display preferences:

You can use the built-in keyboard in your android to write things, or your own desktop keyboard:

However, we found that sometimes it may be tricky to unlock the lock screen; It takes too many weird movements and tries until it finally work. This could be a different behavior depending on the phone and the lock-screen setup.

The mouse-wheel click button is keymapped to the home button on your phone. So this allows you to easily navigate throughout your android system:

Interesting Features

Scrcpy has a number of interesting features:

  • You can record your android phone screen into an MP4 file using scrcpy --record file.mp4, and it has a very great quality.
  • You can launch your android in a rotated view by 90/180 degrees:11 scrcpy
  • Scrcpy does not support audio forwarding, so if you play games/videos on your android phone, the voice will still be coming out from it instead of being forwarded to your desktop PC. However, another program called sndcpy exists to allow audio forwarding in Scrcpy.
  • A huge number of shortcuts for everything is available in Scrcpy; Rotating screen, copying/pasting text, turn device off, restart it… Much more.
  • You can connect to your android phone wirelessly via adb, and you can limit the streaming bitrate to enhance your connection if you are using this method. You can even connect to remote android devices over the Internet with Scrcpy!
  • Scrcpy normally turns on your screen when you use it to control your phone, however, you can use the scrcpy -S option to leave the screen off while controlling it.
  • You can also share files to your android phone (to the /sdcard/ directory) via simply dragging and dropping the files to the Scrcpy window! And if you are dropping an APK file, it will be installed automatically for you!
  • Tons of advanced features are available for more power users.

You can check all features from the Scrcpy GitHub page.

The Bottom Line

Scrcpy is one of these fantastic tools that make one wonder: “This thing is so good to the level it can’t be given for free, how am I getting this for free”? What’s better than that is that Scrcpy is fully open source under the Apache 2.0 license.

Using Scrcpy could be a better tool to have your android phone always connected to your PC instead of deploying it in a QEMU/KVM virtual machine like we explained in a previous post.

Overall, it is a great tool with many options and features that succeeded very well in fulfilling its use case which it was originally designed to fulfill.

.
guest
5 Comments
Oldest
Newest
Inline Feedbacks
View all comments
rom

> However, we found that sometimes it may be tricky to unlock the lock screen; It takes too many weird movements and tries until it finally work.

Alt+m (which injects MENU key) on the lockscreen may help 😉

Eurositi

The “Allow USB debugging” confirmation dialog never appears on my phone, Developer/debugging mode is already activated, but I don’t see any option to bypass the abovementioned error when I start scrcpy.exe. I have tried in user mode as well as admin mode. But the error remains:
“adb: error: failed to get feature set: no devices/emulators found”

Stuck here.

Eurositi

Made it a little further after I found a more detailed guide mentioning that you also need to activate USB debugging in the Settings > Developer menu.
But now I am stuck with this message: “WARN: Device disconnected”

Eurositi

And after activating a few more settings…
WARN: Device disconnected
[server] ERROR: Exception on thread Thread[main,5,main]
android.media.MediaCodec$CodecException: Error 0xfffffc0e

Looks like a bug or a strange incompatibility issue.
I gve up.

Your Full Linux Guide

New to Linux and the open source world? We have compiled a huge list of resources to help you go through Linux and its distributions. Visit the full Linux guide page right now.

Privacy & Security Series

Care about digital privacy and security? We have prepared a long series of important articles to secure your online privacy as a Linux and open source user. Visit the Privacy & Security Series right now.

Subscribe for $5

Instead of using your adblocker, join us now on Patreon to unlock a complete ad-free experience + access to private FOSS Post forum where many internals are discussed.

Email Newsletter

.