UbuntuUbuntu Based

How To Install Scrcpy on Ubuntu 24.04 LTS

Install Scrcpy on Ubuntu 24.04

Android screen mirroring has become essential for developers, content creators, and professionals who need seamless device control from their desktop environment. Scrcpy stands as the industry-leading solution for high-performance Android mirroring on Ubuntu systems. This comprehensive installation guide covers everything needed to successfully deploy scrcpy on Ubuntu 24.04 LTS, ensuring optimal performance and reliability for all Android mirroring requirements.

Ubuntu 24.04 LTS users benefit from multiple installation pathways, each offering distinct advantages for different use cases. The following guide provides detailed instructions, troubleshooting solutions, and advanced configuration options to maximize scrcpy’s capabilities on the latest Ubuntu release.

What is Scrcpy and Why Use It

Scrcpy, pronounced “screen copy,” represents a revolutionary approach to Android device management through desktop integration. This free, open-source application delivers unparalleled performance with frame rates reaching 30-120 fps and remarkably low latency between 35-70 milliseconds.

The application’s core strength lies in its lightweight architecture that requires zero installation on Android devices. Instead, scrcpy leverages Android Debug Bridge (ADB) to establish secure connections, making it compatible with any Android device running API 21 (Android 5.0) or higher.

Core Features and Capabilities

Modern scrcpy versions include comprehensive multimedia support with audio forwarding for Android 11+ devices, enabling complete desktop integration. Screen and audio recording capabilities allow content creators to capture high-quality footage directly from their Ubuntu desktop.

The application supports both wired USB connections and wireless TCP/IP networking, providing flexibility for various workspace configurations. Advanced features include camera mirroring for Android 12+ devices, virtual display support, and OTG mode for direct hardware input simulation.

Copy-paste functionality works bidirectionally between Ubuntu and Android, streamlining workflows for developers and power users. Gamepad support enhances gaming experiences, while keyboard and mouse simulation provides natural desktop-style interaction.

System Requirements and Prerequisites

Ubuntu 24.04 LTS provides excellent compatibility with current scrcpy releases, supporting both Intel and AMD architectures. The system requires minimal resources, though USB 3.0 connections deliver superior performance compared to USB 2.0 alternatives.

Android device compatibility extends to virtually all modern smartphones and tablets. Developer options must be enabled, but root access remains unnecessary, preserving device security and warranty status.

Preparing Your Android Device

Proper Android configuration ensures smooth scrcpy operation and prevents common connection issues. The setup process involves enabling developer features and configuring debug settings without compromising device security.

Enabling Developer Options

Developer options activation requires navigating to Android Settings and locating the “About phone” or “About device” section. Tap the “Build number” entry seven times consecutively until the system displays “You are now a developer” confirmation.

This process unlocks advanced settings necessary for ADB communication. The developer options menu appears in the main settings interface, typically under “System” or “Additional settings” depending on the Android version and manufacturer customization.

Configuring USB Debugging

USB debugging activation occurs within the newly accessible Developer Options menu. Enable the “USB debugging” toggle and confirm the security prompt when prompted.

Xiaomi devices require additional security configuration through the “USB debugging (Security settings)” option to ensure full compatibility with scrcpy. This manufacturer-specific setting prevents authentication failures during initial connection attempts.

When connecting the Android device to Ubuntu, select “File Transfer” or “Media Transfer” mode rather than “Charging only” to establish proper ADB communication. The “Allow USB Debugging” dialog must be accepted on the Android device to authorize the Ubuntu system.

Network Configuration for Wireless Setup

Wireless scrcpy operation requires both devices to connect to the same local network. Android devices running Android 11 or later support enhanced wireless debugging features that simplify the setup process.

Locate the Android device’s IP address through Settings > About phone > Status or through the network settings interface. This information becomes essential for establishing wireless connections and troubleshooting network-related issues.

Installation Methods Overview

Ubuntu 24.04 LTS supports three primary scrcpy installation methods, each offering unique benefits for different user requirements. The official tarball provides the latest features and optimal performance, while package managers offer simplified maintenance and automatic updates.

Snap packages deliver containerized installations with enhanced security isolation, though some advanced features may require additional configuration. The choice between installation methods depends on update preferences, system administration policies, and feature requirements.

Method 1: Installing Official Linux Tarball (Recommended)

The official tarball installation delivers cutting-edge features and maximum performance optimization. GitHub releases provide signed packages ensuring authenticity and security for production environments.

Downloading the Official Release

Navigate to the official scrcpy GitHub releases page and locate the latest stable version. Download the Linux tarball specifically designed for Intel/AMD architectures, avoiding ARM-based packages unless using compatible hardware.

Verify download integrity using provided checksums or GPG signatures when available. This security measure prevents corrupted installations and ensures software authenticity.

Installation Process

Extract the downloaded tarball to a temporary directory using the following command sequence:

tar -xzf scrcpy-linux-x86_64-vX.X.X.tar.gz
cd scrcpy-linux-x86_64-vX.X.X

Create necessary user directories for local installation:

mkdir -p ~/.local/bin ~/.local/share/icons

Copy executable files and resources to appropriate locations:

cp adb scrcpy scrcpy-server ~/.local/bin
cp icon.png ~/.local/share/icons/scrcpy.png

These commands install scrcpy to user-specific directories, avoiding system-wide modifications that require administrative privileges. The ~/.local/bin directory automatically appears in PATH for most Ubuntu configurations.

Verify successful installation by checking version information:

adb --version
scrcpy --version

If ~/.local/bin was newly created, logout and login again to refresh PATH environment variables.

Creating Desktop Application Entry

Desktop integration enhances user experience by providing GUI access through the applications menu. Create a desktop entry file:

cat > ~/.local/share/applications/scrcpy.desktop << EOF
[Desktop Entry]
Name=scrcpy
Comment=Display and control your Android device
Exec=scrcpy
Icon=scrcpy
Terminal=false
Type=Application
Categories=Utility;
EOF

Update the desktop database to register the new application:

update-desktop-database ~/.local/share/applications

Method 2: Installing via APT Package Manager

Ubuntu repositories include scrcpy packages for simplified installation and automatic dependency resolution. This method suits users preferring traditional package management over manual installations.

Using Ubuntu Repository

Install scrcpy directly from official Ubuntu repositories:

sudo apt update
sudo apt install scrcpy

The package manager automatically resolves dependencies and configures system integration. ADB installation may require separate package installation:

sudo apt install android-tools-adb

Repository versions may lag behind latest releases, potentially missing newer features like enhanced audio support or virtual display capabilities. Consider this limitation when choosing installation methods.

Dependency Management

APT automatically handles library dependencies, ensuring proper SDL2, FFmpeg, and USB library installations. System-wide installation provides consistent access for all user accounts.

Verify installation success:

scrcpy --version
adb --version

Method 3: Installing via Snap Package

Snap installation provides containerized deployment with enhanced security isolation. The Snap Store offers unofficial scrcpy distributions maintained by community developers.

Snap Installation Process

Install scrcpy from the Snap Store:

sudo snap install scrcpy

Snap packages include all necessary dependencies within the container, preventing conflicts with system libraries. However, this isolation may limit certain advanced features requiring direct hardware access.

ADB Integration with Snap

Snap confinement may interfere with ADB functionality, requiring external ADB installation:

sudo apt install android-tools-adb

Platform-tools can be downloaded directly from Google for the latest ADB versions when repository packages prove insufficient.

Initial Setup and Connection

Establishing the first connection between Ubuntu and Android requires careful attention to authentication and debugging permissions. Proper setup prevents common issues and ensures reliable operation.

USB Connection Setup

Connect the Android device using a high-quality USB cable, preferably USB 3.0 for optimal data transfer rates. Ensure the Android device operates in “File Transfer” mode rather than “Charging only” to enable ADB communication.

Initialize ADB connection:

adb usb

Verify device recognition:

adb devices

The command should display connected devices with “device” status. “Unauthorized” status indicates pending USB debugging authorization on the Android device.

Basic Scrcpy Launch

Start scrcpy with default settings:

scrcpy

A new window displays the Android screen with full mouse and keyboard interaction enabled. The default configuration provides optimal performance for most use cases without additional customization.

Essential keyboard shortcuts include:

  • Alt+F: Toggle fullscreen mode
  • Alt+G: Resize window to 1:1 (pixel-perfect)
  • Alt+C: Copy device clipboard to computer
  • Alt+V: Paste computer clipboard to device

Troubleshooting Initial Connection Issues

Connection failures typically stem from USB debugging authorization problems or ADB version mismatches. If the “Allow USB debugging” dialog doesn’t appear, try revoking existing authorizations through Developer Options and reconnecting.

Graphics driver issues may cause rendering problems, resolved by forcing software rendering:

scrcpy --render-driver=software

ADB version incompatibilities between Ubuntu and Android can cause core dumps. Using the official tarball installation often resolves these compatibility issues.

Wireless Connection Configuration

Wireless operation eliminates cable constraints and enables flexible workspace arrangements. Both traditional TCP/IP connections and modern wireless debugging protocols provide reliable wireless functionality.

Setting Up TCP/IP Connection

Enable TCP/IP mode while the device remains USB-connected:

adb tcpip 5555

Obtain the Android device’s IP address and establish wireless connection:

adb connect 192.168.1.100:5555

Replace the IP address with your device’s actual network address. Successfully connected devices display in adb devices output with IP addresses instead of USB identifiers.

Disconnect the USB cable after establishing the wireless connection. The device remains accessible through the network connection for scrcpy operation.

Android 11+ Wireless Debugging

Modern Android versions support enhanced wireless debugging through dedicated pairing mechanisms. Enable “Wireless debugging” in Developer Options and use the pairing dialog for secure connection establishment.

Pair devices using the six-digit code:

adb pair 192.168.1.100:37843

Enter the pairing code when prompted to establish the trusted connection.

Optimizing Wireless Performance

Network limitations require performance adjustments for smooth wireless operation. Reduce resolution and bitrate for optimal wireless experience:

scrcpy --max-size 800 --bit-rate 2M

Frame rate limitations prevent network congestion:

scrcpy --max-fps 30

Wireless Connection Troubleshooting

Network connectivity issues often stem from firewall configurations or router limitations. Ensure both devices connect to the same subnet and verify port accessibility.

Connection timeouts indicate network instability or insufficient bandwidth. Adjust bitrate and resolution settings to match network capabilities.

Advanced Configuration and Features

Scrcpy’s extensive configuration options enable customization for specific use cases, from gaming to professional content creation. Understanding these parameters maximizes application potential.

Audio Configuration

Audio forwarding requires Android 11 or later with specific source configuration:

scrcpy --audio-source=playback

Duplicate audio on both Android and Ubuntu systems:

scrcpy --audio-source=playback --audio-dup

Microphone forwarding enables voice communication through Ubuntu:

scrcpy --audio-source=mic

Display and Video Settings

Resolution scaling improves performance on high-resolution displays:

scrcpy --max-size 1920

Frame rate optimization for gaming applications:

scrcpy --max-fps 60

Video codec selection affects quality and performance:

scrcpy --video-codec=h265

Display orientation adjustment for landscape applications:

scrcpy --display-orientation=90

Window Management

Borderless window mode for immersive experiences:

scrcpy --window-borderless

Always-on-top window behavior:

scrcpy --always-on-top

Custom window positioning and dimensions:

scrcpy --window-x=100 --window-y=100 --window-width=800 --window-height=600

Recording and Screen Capture

Screen recording with audio capture:

scrcpy --record=recording.mp4 --audio-source=playback

Format specification for compatibility:

scrcpy --record=output.mkv --record-format=mkv

Camera recording capabilities for Android 12+:

scrcpy --camera-id=0 --record=camera.mp4

Gaming and Input Configuration

Gamepad support for enhanced gaming:

scrcpy --gamepad=uhid

Physical keyboard simulation for gaming applications:

scrcpy --keyboard=uhid

OTG mode for direct hardware input without screen mirroring:

scrcpy --otg

Performance Optimization

Optimal scrcpy performance requires balancing quality settings with system capabilities. Understanding performance parameters enables smooth operation across various hardware configurations.

System Performance Tuning

CPU optimization through thread management and process priorities improves responsiveness. Monitor system resources during operation to identify bottlenecks.

Memory usage remains minimal for typical operations, though high-resolution recording increases RAM requirements significantly. Close unnecessary applications to free system resources.

Network bandwidth optimization becomes critical for wireless operations, requiring bitrate adjustments based on connection quality.

Quality vs Performance Balance

Resolution scaling provides the most significant performance improvement for lower-end systems:

scrcpy --max-size 720

Frame rate limitations reduce CPU usage:

scrcpy --max-fps 30

Codec selection impacts both quality and performance:

scrcpy --video-codec=h264  # Better compatibility
scrcpy --video-codec=h265  # Better compression

Bitrate optimization for wireless connections:

scrcpy --bit-rate 1M  # Conservative setting
scrcpy --bit-rate 8M  # High quality setting

Hardware-Specific Optimizations

Graphics driver selection affects rendering performance significantly. Intel integrated graphics may benefit from software rendering:

scrcpy --render-driver=software

NVIDIA and AMD discrete graphics typically perform best with default OpenGL rendering.

USB 3.0 connections provide superior bandwidth compared to USB 2.0, enabling higher bitrates and resolutions without performance degradation.

Network adapter quality affects wireless performance, with 802.11ac or newer standards recommended for high-quality wireless mirroring.

Troubleshooting Common Issues

Systematic troubleshooting resolves most scrcpy issues quickly. Understanding common problems and their solutions prevents extended downtime.

Connection Problems

Device recognition failures often indicate USB debugging authorization issues. Revoke existing authorizations through Developer Options and reconnect to trigger the authorization dialog.

ADB version mismatches cause compatibility problems, particularly between Ubuntu 24.04’s newer ADB and older Android implementations. Installing the official tarball resolves most version conflicts.

USB cable quality significantly affects connection reliability. Use high-quality cables rated for data transfer rather than charging-only cables.

Performance Issues

Frame skipping and lag typically result from insufficient system resources or network bandwidth limitations. Reduce resolution and frame rate to match system capabilities.

Audio synchronization problems occur with wireless connections experiencing variable latency. Wired connections provide more consistent audio-video synchronization.

High CPU usage may indicate graphics driver issues, resolved by switching to software rendering:

scrcpy --render-driver=software

Graphics rendering failures manifest as black screens or corrupted displays, typically resolved through driver updates or alternative render drivers.

Ubuntu 24.04 Specific Issues

Dependency resolution problems may occur with mixed installation methods. Remove conflicting packages before installing preferred versions.

Library compatibility issues between Snap and native packages require careful package management to avoid conflicts.

Wayland display server compatibility generally works well, though X11 sessions may provide better performance for intensive operations.

Device-Specific Solutions

Xiaomi devices require security settings configuration in Developer Options to enable full USB debugging functionality. Enable “USB debugging (Security settings)” in addition to standard USB debugging.

Samsung devices may require specific USB driver installations on some Ubuntu configurations, though most modern versions include necessary drivers by default.

OnePlus and other manufacturer customizations occasionally interfere with standard ADB protocols, resolved through firmware updates or alternative USB debugging methods.

Security and Privacy Considerations

Understanding scrcpy’s security implications ensures safe operation while maintaining privacy and system security. The application’s design minimizes security risks through local processing.

Understanding ADB Security

USB debugging grants significant device access, enabling file transfers, application installation, and system modification. Limit USB debugging authorization to trusted computers and revoke access when unnecessary.

Network exposure through wireless connections requires secure network configurations. Avoid public Wi-Fi networks for wireless scrcpy operation to prevent unauthorized access.

ADB authorization keys stored on Android devices persist across sessions. Regularly review and revoke outdated authorizations through Developer Options.

Data Privacy

Scrcpy processes all data locally without cloud services or external data transmission. Screen content, audio, and input data remain within the local network environment.

No telemetry or usage analytics collection occurs, preserving user privacy throughout operation. This local-only approach contrasts favorably with cloud-based alternatives requiring data transmission.

Recording and screenshot capabilities store content locally, providing complete user control over sensitive data.

Best Practices

Secure wireless networks with WPA3 encryption provide optimal security for wireless scrcpy operation. Avoid unencrypted or poorly secured networks that expose communication.

Regular security updates for both Ubuntu and Android maintain protection against emerging vulnerabilities. Monitor scrcpy releases for security patches and feature improvements.

Proper device authorization management prevents unauthorized access while maintaining convenient operation for legitimate use cases.

Congratulations! You have successfully installed Scrcpy. Thanks for using this tutorial for installing Scrcpy open-source application mirrors and controls an Android device on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official Scrcpy website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button