Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

scrcpy: A Lightweight Open-Source Android Screen Mirroring Tool

Tech 1

Screen mirroring an Android device to a computer is a common need, but seamless integration is often limited to same-brand ecosystems (e.g., Huawei, Honor, Apple). For cross-brand setups, many third-party tools are either paid or bloated—until you discover scrcpy.

scrcpy Overview

GitHub Repository: https://github.com/Genymobile/scrcpy

Derived from "screen copy", scrcpy is a portmanteau that encapsulates its core functionality. It enables mirroring Android devices via USB or TCP/IP, supports video and audio transmission, and lets you control the device using your computer’s keyboard and mouse. No root access is required, and it works seamlessly across Linux, Windows, and macOS operating systems.

Key Features

  • Lightweight: Runs locally, with no extra frills beyond displaying the device screen.
  • High Performance: 30–120 frames per second, depending on the device’s hardware capabilities.
  • Superior Quality: Supports resolutions up to 1920×1080 or higher.
  • Low Latency: Just 35–70 milliseconds for near real-time interaction.
  • Blazing Fast Startup: Renders the first frame in approximately 1 second.
  • Non-Intrusive: Leaves no residual installations or files on the Android device.
  • User-Centric: No account registration, ads, or internet connection required.
  • Free and Open Source: Released under an open-source license for full transparency and customization.

Using scrcpy

Download the latest version from the project’s GitHub releases page. The Windows build is a mere 5.6MB, making it extreme lightweight.

Wired Screen Mirroring

  1. Connect your Android device to your computer using a USB cable. Verify the connection with the adb tool (included in the scrcpy package):
    adb devices -l
    
    Sample output:
    List of devices attached
    XYZ123456789   device product:XYZ-ABC model:XYZ_ABC device:XYZ transport_id:2
    
  2. Launch the mirroring sesssion by running:
    scrcpy
    
    Sample output:
    scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
    INFO: ADB device found:
    ...
    

scrcpy supports advanced command-line parameters for customized workflows:

  • Record your device’s camera feed (with audio) in H.265 codec at 1920×1080 resolution to an MP4 file:
    scrcpy --video-source=camera --video-codec=h265 --camera-size=1920x1080 --record=cam_recording.mp4
    
  • Control your Android device using your computer’s keyboard and mouse without screen mirroring (no USB debugging required):
    scrcpy --otg
    

Wireless Screen Mirroring

For cable-free mirroring, use TCP/IP to connect your devicee:

  1. Keep your Android device connected via USB initially.
  2. Retrieve your device’s IP address using:
    adb shell ifconfig wlan0
    
    Sample output (look for the inet addr field):
    wlan0     Link encap:UNSPEC
              inet addr:192.168.1.105  <- Device IP Address
    
  3. Switch your device to TCP/IP mode with port 5555:
    adb tcpip 5555
    
    Successful output:
    restarting in TCP mode port: 5555
    
  4. Unplug the USB cable from your device.
  5. Establish a wireless connection to your device:
    adb connect 192.168.1.105:5555
    
    Sample confirmation:
    connected to 192.168.1.105:5555
    
  6. Start the wireless mirroring session with:
    scrcpy
    
    Sample output indicating wireless connection:
    scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
    INFO: ADB device found:
    INFO:     --> (tcpip)  192.168.1.105:5555     <-- Wireless Mirroring Active
    

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.