Connectivity between an Android phone and a Linux OS such as Ubuntu is definitely not a problem. With utilities like KDE Connect, you get so much more than just AirDrop like functionality. While you can remote control your PC from your phone with KDE Connect, you still don’t get the ability to mirror or control Android from Ubuntu (Linux).
There are plenty of other tools available out there that let you mirror your Android to your PC and control it. Screen mirroring on or from Android is nothing new. But most of them either want you to install another app on your phone or pay for a subscription, like Vysor and AirDroid. Frankly, it’s not quite worth it. Most people either want to do it for fun or on rare occasions. That’s where Scrcpy comes in.
Scrcpy is available on Linux as a Snap app which can be installed on any Linux distribution. There is also an AUR package available for Arch Linux and an Ebuild for Gentoo. For everyone else, it’s either the Snap package or building it on your own. This requires Snap support to be enabled on your system. Ubuntu 18.04 and above, Solus 3 and Zorin OS already have Snap support built-in.
To install Scrcpy on Ubuntu or any other Linux distribution, run the following command in a Terminal.
sudo snap install scrcpy
You can also follow either of the links below:
- USB debugging must be enabled on your phone. If you don’t know how to do it, we’ll guide you through it.
- Scrcpy requires API 21 or above. This implies that your Android device must be running Android 5.0 or above.
How to Mirror & Control Android from Ubuntu
Before we get to the fun part of mirroring Android on Linux, you’ll need to enable USB debugging on your phone.
Enable USB Debugging on Android
- On your Android device, go to Settings > About phone.
- Tap on the Build number seven times and you will see a toast notification saying you’re now a developer.
- Go back to Settings and tap System.
- You’ll find a new section labeled Developer options here.
- If you’re using versions of Android older than Android 8.0 Oreo, you can find Developer options directly under Settings near the bottom of the list.
- Go to Developer options.
- Scroll down until you find the USB debugging toggle under the DEBUGGING section.
- Turn the USB debugging toggle on.
- Tap OK on the confirmation dialog that appears.
Use Scrcpy To Mirror Android On Ubuntu (Linux)
- Connect your Android device to your PC with a USB cable.
- Launch a Terminal window from the app launcher or press Ctrl+Alt+T.
scrcpyin the terminal and hit Enter to launch Scrcpy.
- On your phone, you should now get a pop-up asking to Allow USB debugging permissions to your PC.
- Tap OK.
- Scrcpy should now start screen mirroring your Android on your Ubuntu (Linux) PC in a couple of seconds.
In the off chance, if screen mirroring doesn’t work the first time, run Scrcpy again. Sometimes due to delay in allowing the necessary permission, things don’t work out. Running the command again should do the trick.
If it does, you can now control your Android from your Ubuntu or Linux PC using the mouse and keyboard. A click equals a tap so naturally, click and hold equals a long press. When you click on a text input field, the onscreen keyboard does open up, but you can use your PC’s keyboard for a much better typing experience.
Scrcpy: Mirror & Control Android from Ubuntu
Scrcpy is a free, open-source tool designed to let you mirror your Android phone in a free-floating window on your PC. But chances are if you want to see your phone’s screen on your PC, you also want to be able to interact with it. You can. Scrcpy also lets you control Android from your Windows, Mac, Or Linux PC including Ubuntu. You can do this using the mouse and keyboard.
- Does not require root access.
- Available for Windows, macOS & Linux.
- No app required on the phone.
- Low latency/lag (35~70ms)
- Better refresh rates (30fps to 60fps)
- High-resolution Android screen mirroring (1920 x 1080 and above)
- Fast startup. Takes merely a second.
- Allows typing using your computer keyboard.
- Interaction using your mouse.
This nifty little tool was created by the team that brought us Genymotion. Genymotion is an Android emulator for Windows, Mac, and Linux. Its purpose is to help Android app developers test out their apps easily. Therefore, it shouldn’t surprise anyone that Scrcpy can also aid developers. You can easily drag and drop an APK file onto the floating window to install it on your phone.
The window is resizable and changes its size automatically when your device orientation is changed. That and the interaction is in real-time. Since it uses a USB connection, there’s little to no perceivable lag or stutter either. Scrcpy runs by creating a server on your Android device which the desktop app uses for mirroring and control of your Android from the PC.
One can, therefore, also use Scrcpy to wirelessly mirror and control Android from Ubuntu. You’ll need to install the necessary Android SDK platform-tools and enable wireless ADB debugging on your phone though. Since everything simply just works using a USB cable, it’s just more convenient.
Scrcpy on GitHub
On the surface, Scrcpy doesn’t offer much else. You can start screen mirroring, and end it, and that’s all. However, Scrcpy does allow changing a few things as per your preference. Unfortunately, all of that happens via the command line, i.e. inside the Terminal.
If you’re not afraid to experiment though, you can change the default resolution, bit-rate, etc. Visit the Scrcpy GitHub page to learn more.