Lesson 5 of 19 ↓
- 1.Fedora + Distrobox + Arch + AUR Setup Guide
- 2.Enabling Hibernate on Linux
- 3.A Practical Git Workflow
- 4.Useful Linux Commands & Tips
- 5.Mirroring Your Android Screen with Scrcpy
- 6.Downloading Media with Yt-dlp
- 7.Consistent C/c++ Style with Clang-format
- 8.Auto-mounting Drives at Boot
- 9.Customizing Grub
- 10.Linux Swap Files Explained
- 11.Zram: Compressed Swap in Ram
- 12.Custom App Launch Behavior Via .desktop Files
- 13.Custom Mime Icons in Gnome
- 14.Fixing Missing Dock Icons (startupwmclass)
- 15.Installing Questasim for Hdl Simulation
- 16.Building Python 2 From Source
- 17.Auto-Starting WhatsApp and Telegram (Minimized or Tray)
- 18.Custom Neovim Configuration Guide
- 19.Running Windows Applications on Linux Seamlessly with WinBoat (Docker)
2 min read
Mirroring Your Android Screen with Scrcpy
scrcpy displays and controls an Android phone from a Linux PC, over either USB or Wi-Fi, with low latency and no root required — a solid open-source replacement for tools like Iriun.
Installation
Prebuilt packages exist for most distros:
Debian / Ubuntu : apt install scrcpy (often an outdated version in repos)
Arch Linux : pacman -S scrcpy
Fedora : dnf copr enable zeno/scrcpy && dnf install scrcpy
Gentoo : emerge scrcpyFor up-to-date package availability across distros, check repology.org/project/scrcpy/versions.
To build from source on Debian/Ubuntu, the dependencies are:
sudo apt install ffmpeg libsdl2-2.0-0 adb wget \
gcc git pkg-config meson ninja-build libsdl2-dev \
libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev \
libswresample-dev libusb-1.0-0 libusb-1.0-0-devPhone Setup
Enable Developer Options: Settings → About phone → tap "Build number" 7 times.
Enable debugging: Settings → Developer options → turn on both USB debugging and Wireless debugging (Android 11+).
Method 1 Usb (most Stable)
Connect the phone, accept the debugging prompt it shows, then:
scrcpyThe phone screen appears immediately.
Method 2 Wi-fi
Both phone and PC must be on the same Wi-Fi network.
Option A — legacy TCP/IP (doesn't work on every phone):
adb tcpip 5555
adb connect <IP_ADDRESS>:5555
adb devices # verify
scrcpy -eOption B — Wireless Debugging (recommended, Android 11+): this is the official, stable method.
On the phone: Settings → Developer options → Wireless debugging → on, then pair the device with the pairing code shown. The phone displays an IP address, a pairing port, and a pairing code.
On the PC:
adb pair <IP_ADDRESS>:<PAIR_PORT> # enter the pairing code when prompted
adb connect <IP_ADDRESS>:<CONNECT_PORT>
adb devices # verify
scrcpy -eFully wireless, stable, no cable needed once paired.
Verifying the Connection
adb devices<IP_ADDRESS>:<PORT> deviceUseful Scrcpy Options
scrcpy --camera-facing=front # use the front camera instead of mirroring the screen
scrcpy -e --bit-rate=4M # limit bitrate — helps on a weaker Wi-Fi link
scrcpy --max-fps=30 # cap the frame rateNote
- USB is always the most stable option; Wi-Fi quality depends on the router and signal strength.
- Wireless Debugging is preferred over the legacy
adb tcpip 5555method.- No root access is required either way.
Comments
Loading the discussion…