Scrcpy Open Source Software Let You Control an Android Phone via a Windows, Mac OS, or Linux PC

Orange Pi Development Boards

Have you ever wished you could control or mirror your Android smartphone using your computer? Scrcpy, a free and open source program by Genymotion may fit your needs, and works on Windows, Mac OS or Linux. You just need to install (or build) a program on your host computer, connect your phone via USB, switch to developer mode, enable USB debugging, and run the program which will automatically install the server (a jar file) on your phone, which does not need to be rooted.

The easiest way to try is with Windows since the developers already provide pre-built binaries, but I installed it on Ubuntu 16.04 instead since it is the operating system I use daily. Some of the packages in Ubuntu 16.04 are a bit old so it took me a couple of hours to successfully install it, and I’d recommend going with Ubuntu 17.10 or 18.04 daily build if you can.

First let’s create a working directory, and retrieve the source code

We also need to install some dependencies to run (first line) and build (second) the program:

The original instructions for Debian also list meson and libsdl2-dev, but Meson 0.29 is installed in Ubuntu 16.04, and we need version 0.37 or greater. So I used pip to install the most recent version (0.45):

libsdl2-dev refused to install too, and I had to enable xenial-proposed in /etc/apt/sources.list:

before installing it:

Those two problems should not occur in more recent versions of Ubuntu.

We are also supposed to install the Android SDK, but it’s only if you plan to build the server part, and it’s optional. I leave the steps I followed, but feel free to skip that part.

Download, install, and launch Android Studio:

Download the latest Android SDK in the Android Studio SDK, and accept the license agreement.
That’s the important bit, or the build will fail. However in my case, it still failed… as there’s a mismatch between the expect version (26.0.2) and my version (26.1.1).

You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 26.0.2, Android SDK Platform 27].

I have not looked into a fix that long, once I realized there was a prebuilt server (the binary that needs to be copied to the phone), and only built the Linux app:

scrcpy should be installed in your path now. Make sure your phone is connected over adb, and USB debugging is enabled in your phone in the Developer Options.

You may now optionally want to open a terminal to check your phone is detected:

Time to start the program, simply type:

Within a few second you should see your phone display appear on your desktop… 🙂

Click to Enlarge

You can control the display with your mouse and keyboard, and the window is fairly responsive, although not always extra smooth at all time. This may vary with the phone and computer used. It also a way to mirror your phone on a large screen using the touchscreen for control. Apart from applications or actions requiring multi-touch, I could do anything I want to the mouse and keyboard, send SMS, chat, browser the web, play games, etc…

Click to Enlarge

Landscape mode is also working, and the window will automatically switch following your phone’s orientation.

Click to Enlarge

The window can also be maximized. Not quite full size, but close to it… Audio is still going through the phone speakers.

There are no software button for Home, Back, and App Switch, so you may want to learn a few screenshot to fully utilize the capabilities of the program:

switch fullscreen mode Ctrl+f
resize window to 1:1 (pixel-perfect) Ctrl+g
resize window to remove black borders Ctrl+x
click on HOME Ctrl+h
click on BACK Ctrl+b
click on APP_SWITCH Ctrl+m
click on VOLUME_UP Ctrl++
click on VOLUME_DOWN Ctrl+-
click on POWER Ctrl+p
turn screen on Right-click
paste computer clipboard to device Ctrl+v
enable/disable FPS counter (on stdout) Ctrl+i

FPS Counter? Interesting. I enabled it while panning and zoom-in and out in MAPS.ME app.

Click to Enlarge

The frame rate dropped to around 30 fps with some frames skipped from time to time, so not perfectly, but still not too bad. Give it a try!

Via Liliputing and Reddit

8 Replies to “Scrcpy Open Source Software Let You Control an Android Phone via a Windows, Mac OS, or Linux PC”

  1. wow, thanks for posting, didn’t know that program.
    it’s currently segfaulting here after some seconds, but anyway very promising!

  2. @Stane1983

    No, it do not works over wifi-adb, prints: ‘error more than once device/emulator”, ERROR: “adb reverse” returned with value 1’. All is ok over cable even youtube.

  3. After installing scrcpy on two Ubuntu 16.04 (64 bit) I tried to simplify the (installation) process in order to deploy scrcpy on many machines at job.

    Using the scrcpy and scrcpy-server.jar generated binaries I done:

    sudo cp -p scrcpy /usr/local/bin/.
    sudo chmod 755 /usr/local/bin/scrcpy
    sudo chown root:root /usr/local/bin/scrcpy

    sudo mkdir /usr/local/share/scrcpy
    sudo chmod 755 /usr/local/share/scrcpy
    sudo chown root:root /usr/local/share/scrcpy
    sudo cp -p scrcpy-server.jar /usr/local/share/scrcpy/.
    sudo chmod 644 /usr/local/share/scrcpy/scrcpy-server.jar
    sudo chown root:root /usr/local/share/scrcpy/scrcpy-server.jar

    And I installed also the adb (Android Device Bridge) Ubuntu package:

    sudo apt-get update
    sudo apt-get install adb

    I put these steps on a script and that’s all!

    It seems that our computers have the necessary dependencies and we don’t need more packages (using the generated binaries from a first installation on another computer):

    objdump -p /usr/local/bin/scrcpy | grep NEEDED

Leave a Reply

Your email address will not be published. Required fields are marked *