Mirror Your Android Phone to Ubuntu with Scrcpy – Complete Step‑by‑Step Guide
This article explains how to use the open‑source Scrcpy tool to mirror an Android device onto an Ubuntu system, covering installation, required Android version, USB and wireless connections, screen configuration, recording, window options, input control, and file transfer commands.
Scrcpy Overview
Scrcpy is a free, open‑source command‑line utility that lets you control an Android device from a computer via ADB or a USB cable, supporting mouse, keyboard, and clipboard synchronization without requiring root access.
Main Features
Free and open source
No root required
Runs on Linux, Windows, and macOS
Clipboard sharing
Lightweight (native display only)
30‑60 fps performance
Up to 1920×1080 resolution or higher
35‑70 ms latency
Fast start‑up (seconds)
Non‑intrusive (no app needed on the device)
Requirements
Android 5.0 (API 21) or newer
ADB debugging enabled on the device
Optional: additional options for mouse/keyboard control on some devices
Installing Scrcpy on Ubuntu
From the default repository: sudo apt-get install scrcpy Or compile from source (install dependencies first):
# runtime dependencies
sudo apt install ffmpeg libsdl2-2.0-0 adb
# client build dependencies
sudo apt install gcc git pkg-config meson ninja-build \
libavcodec-dev libavformat-dev libavutil-dev \
libsdl2-dev
# server build dependencies
sudo apt install openjdk-8-jdkRunning Scrcpy
Connect the device via USB and execute: scrcpy Show all command‑line options:
scrcpy --helpScreen Settings
1. Resolution
Limit the displayed size (e.g., max 1024 px):
scrcpy --max-size 1024
scrcpy -m 1024 # short version2. Bit‑rate
Default is 8 Mbps; change to 2 Mbps:
scrcpy --bit-rate 2M
scrcpy -b 2M # short version3. Frame Rate
Cap FPS (e.g., 15 fps):
scrcpy --max-fps 154. Cropping
Show only a portion of the screen:
scrcpy --crop 1224:1440:0:05. Lock Video Orientation
scrcpy --lock-video-orientation 0 # natural
scrcpy --lock-video-orientation 1 # 90° CCW
scrcpy --lock-video-orientation 2 # 180°
scrcpy --lock-video-orientation 3 # 90° CWScreen Recording
scrcpy --record file.mp4
scrcpy -r file.mkvRecord without displaying:
scrcpy --no-display --record file.mp4
scrcpy -Nr file.mkvConnection Methods
Wireless (TCP/IP)
Connect device and PC to the same Wi‑Fi network.
Find the device IP (Settings → About phone → Status).
Enable TCP/IP on the device: adb tcpip 5555 Disconnect USB.
Connect from PC: adb connect DEVICE_IP:5555 Run scrcpy.
Multiple Devices
Specify the serial number:
scrcpy --serial 0123456789abcdef
scrcpy -s 0123456789abcdefFor TCP/IP devices, use the IP address in the same way.
Auto‑start on Device Connection
autoadb scrcpy -s '{}'SSH Forwarding
adb kill-server
ssh -CN -L5037:localhost:5037 -R27183:localhost:27183 your_remote_computer
# keep this window open
scrcpyWindow Settings
Title: scrcpy --window-title 'My device' Position & size:
scrcpy --window-x 100 --window-y 100 --window-width 800 --window-height 600Borderless: scrcpy --window-borderless Always on top: scrcpy --always-on-top Fullscreen: scrcpy --fullscreen or scrcpy -f Rotate window: scrcpy --rotation 1 (values 0‑3)
Other Display Options
Read‑only (disable control): scrcpy --no-control or scrcpy -n Select display (for multiple monitors): scrcpy --display 1 Keep device awake: scrcpy --stay-awake or scrcpy -w Turn device screen off: scrcpy --turn-screen-off or scrcpy -S Render expired frames (disable frame skipping): scrcpy --render-expired-frames Show touches: scrcpy --show-touches or scrcpy -t Disable screensaver:
scrcpy --disable-screensaverInput Control
Rotate device screen with MOD+r.
Clipboard sync works automatically; standard Ctrl+C/X/V are forwarded.
Inject copy/paste via MOD keys: MOD+c, MOD+x, MOD+v.
Pinch‑zoom: hold Ctrl and drag mouse.
Prefer text input (use text events): scrcpy --prefer-text.
Disable key repeat: scrcpy --no-key-repeat.
File Transfer
Install an APK by dragging the .apk file onto the Scrcpy window.
Push other files to /sdcard/ by dragging them onto the window.
Change target directory:
scrcpy --push-target /sdcard/foo/bar/Hotkeys
Default modifier is left Alt or left Super (Windows/Cmd). Change with --shortcut-mod (e.g., scrcpy --shortcut-mod=rctrl).
Custom ADB Path
Set the ADB executable via environment variable: ADB=/path/to/adb scrcpy Override the Scrcpy server path with SCRCPY_SERVER_PATH if needed.
Source
Source: 一口Linux
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
