Extending Android Device On Desktop
- by Joe Jr Yamut
Rediscovered this really cool app named scrcpy recently. I think I’ve read about it before but never bothered about it. Until now. Because my needs have changed and I actually have a use case for this app now. More on that later down there.
scrcpy – Now that is just a weird name. Need I say it is hard to pronounce? Doesn’t even make sense, does it not? It supposedly is short for Screen Copy. Because that’s what it does, copy or mirror your android screen over to your desktop (and more).
In a nutshell, this app lets you fully control your Android smartphone/tablet on your desktop.
Well, almost. Yup! I don’t think you can take in calls – audio or video – through it.
As per their README description over at https://github.com/Genymobile/scrcpy:
This application provides display and control of Android devices connected on USB (or over TCP/IP). It does not require any root access. It works on GNU/Linux, Windows and macOS.
Okay, I’m not an Android developer. I did try my hand at it, including rooting my phones, installing custom ROMs, even dual-booting with Ubuntu Phone on my Nexus 5 at some point. But these weren’t anything serious. Just a passing hobby. Went over a couple of Android app development tutorials way back too. In fact, in my previous company in Singapore, I remember I created a bare minimum Android application that let’s me push notifications on my phone so I can see what it will look like. I think that’s what it was. Anyway, I digress.
Going back. When I’m at home, alone, I think I spend more of my time on my laptop rather than on mobile phone or the TV. Perhaps the TV could be on too but that’s because it’s not too interactive. Not a smart one. But I hate having to take my hands of the keyboard to see/get something on the phone. Like 2FA apps to get the code or through SMS, and even text messages on my myriad messengers installed that I don’t want to or doesn’t have a desktop option. (Note that I refuse to use Facebook for Messenger on my desktop browsers. Good thing Viber has a desktop app and Hangouts, of course, I can access anywhere.)
This app lets me not have to do that. I just load up scrcpy. That’s it.
Word of warning though. It can get hard controlling a touch screen with a mouse. Unless if you have a touch screen monitor. Secondly, this app also does not have a GUI. It is a terminal app. But you should be able to create a desktop shortcut because at the minimum you only need one command to run it and just forget about it.
Note: Commands will be prefixed with a :~$ to be more readable and obvious. But do not include it when typing the same commands in your terminal. e.g. :~$ sudo ls -la should just be sudo ls -la when you copy/type it in.
Before everything, you need to have special Android tools installed. No you don’t need Android Studio or the Android SDK. The Android Debug Bridge, or ADB, is the developer tool that is needed.
On Ubuntu, fire up your terminal and apt get it.
:-$ sudo apt install android-tools-adb
Check which adb version you have after. You need to have at least version 1.0.39 to run scrcpy. As of this writing the latest scrcpy version is 1.14 and the latest adb version is 1.0.41.
:-$ adb version
If you don’t have the required version you can update it like so, then check your adb version again:
:-$ wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
:-$ sudo unzip -d /usr/local/sbin platform-tools-latest-linux.zip
:-$ sudo wget -O /usr/local/sbin/adb https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/android/adb
:-$ sudo chmod +x /usr/local/sbin/platform-tools/adb /usr/local/sbin/adb
Make sure you have Developer Mode/Options enabled on your Android. This can be done so by tapping on the the Build Number/Version several times if you have not done so. Then set USB Debugging to ON.
On Ubuntu, you can have it through their repositories (on 20.04) or as Snap. Or, “You could also build the app manually (don’t worry, it’s not that hard)”.
:-$ sudo apt install scrcpy
:-$ sudo snap install scrcpy
For other operating systems – Linux (other supported distros), Mac and Windows – you can head over to their GitHub page for more information.
At the very least you only need one command, no root or sudo required, to run it. That is from the terminal, of course, I may have mentioned this already.
There are other options available. You can even run it over Wifi on your local network.
Below is a screenshot of my Nokia Android device mirrored on the desktop. The lower part doesn’t have rounded corners. Don’t know what’s up with that, but otherwise, it is working as expected.
Connect Via Wi-Fi
So the steps to connect wirelessly to your Android according to their GitHub page are:
- Know your device’s IP address beforehand.
- Device and desktop must be on the same Wi-Fi network.
- While plugged in via USB, on a terminal enable TCP/IP and add a port like so, :-$ adb tcpip 5555
- Unplug device.
- Connect to device like so, :-$ adb connectIP_ADDRESS:5555
- Run scrcpy.
Update: scrcpy does not seem to work over the air in my case. I get the error below. Must be missing something?
INFO: scrcpy 1.14 https://github.com/Genymobile/scrcpy adb: error: failed to get feature set: no devices/emulators found ERROR: "adb push" returned with value 1
Disclaimer: Please review sources/scripts/commands before installing/executing on your device.
- > Nintendo Switch Send To Smartphone Connection Failure January 19, 2022
- > ROOTing An Android Phone May VOID Its Warranty January 7, 2011
- > Getting That Ubuntu Snap Icon Right On Unity Shell August 13, 2020
- > Bind Super Key To Application Launcher on KDE March 6, 2014
- > Ubuntu Phones Soon To Be A Reality March 4, 2014
Rediscovered this really cool app named scrcpy recently. I think I’ve read about it before but never bothered about it. Until now. Because my needs have changed and I actually have a use case for this app now. More on that later down there. scrcpy – Now that is just a weird name. Need I…