MCPcopy Index your code
hub / github.com/Genymobile/scrcpy

github.com/Genymobile/scrcpy @v4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.0 ↗ · + Follow
2,646 symbols 6,804 edges 277 files 118 documented · 4% 3 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

This GitHub repo (https://github.com/Genymobile/scrcpy) is the only official source for the project. Do not download releases from random websites, even if their name contains scrcpy.

scrcpy (v4.0)

scrcpy

pronounced "screen copy"

This application mirrors Android devices (video and audio) connected via USB or TCP/IP and allows control using the computer's keyboard and mouse. It does not require root access or an app installed on the device. It works on Linux, Windows, and macOS.

Linux  Windows  macOS 

screenshot

It focuses on:

  • lightness: native, displays only the device screen
  • performance: 30~120fps, depending on the device
  • quality: 1920×1080 or above
  • low latency: 35~70ms
  • low startup time: ~1 second to display the first image
  • non-intrusiveness: nothing is left installed on the Android device
  • user benefits: no account, no ads, no internet required
  • freedom: free and open source software

Its features include: - audio forwarding (Android 11+) - recording - virtual display - mirroring with Android device screen off - copy-paste in both directions - configurable quality - camera mirroring (Android 12+) - mirroring as a webcam (V4L2) (Linux-only) - physical keyboard and mouse simulation (HID) - gamepad support - OTG mode - and more…

Prerequisites

The Android device requires at least API 21 (Android 5.0).

Audio forwarding is supported for API >= 30 (Android 11+).

Make sure you enabled USB debugging on your device(s).

On some devices (especially Xiaomi), you might get the following error:

Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.

In that case, you need to enable an additional option USB debugging (Security Settings) (this is an item different from USB debugging) to control it using a keyboard and mouse. Rebooting the device is necessary once this option is set.

Note that USB debugging is not required to run scrcpy in OTG mode.

Get the app

Must-know tips

Usage examples

There are a lot of options, documented in separate pages. Here are just some common examples.

  • Capture the screen in H.265 (better quality), limit the size to 1920, limit the frame rate to 60fps, disable audio, and control the device by simulating a physical keyboard:

    bash scrcpy --video-codec=h265 --max-size=1920 --max-fps=60 --no-audio --keyboard=uhid scrcpy --video-codec=h265 -m1920 --max-fps=60 --no-audio -K # short version

  • Start VLC in a new virtual display (separate from the device display):

    bash scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc

  • Start VLC in a new flex display using H.265 with a bitrate of 16 Mbps, while keeping the display active so it does not turn off:

    bash scrcpy --new-display -x --keep-active --start-app=org.videolan.vlc --video-codec=h265 -b16M

  • Record the device camera in H.265 at 1920x1080 (and microphone) to an MP4 file:

    bash scrcpy --video-source=camera --video-codec=h265 --camera-size=1920x1080 --record=file.mp4

  • Capture the device front camera and expose it as a webcam on the computer (on Linux):

    bash scrcpy --video-source=camera --camera-size=1920x1080 --camera-facing=front --v4l2-sink=/dev/video2 --no-playback

  • Control the device without mirroring by simulating a physical keyboard and mouse (USB debugging not required):

    bash scrcpy --otg

  • Control the device using gamepads plugged into the computer:

    bash scrcpy --gamepad=uhid scrcpy -G # short version

User documentation

The application provides a lot of features and configuration options. They are documented in the following pages:

Resources

Articles

Contact

You can open an issue for bug reports, feature requests or general questions.

For bug reports, please read the FAQ first, you might find a solution to your problem immediately.

You can also use:

Donate

I'm @rom1v, the author and maintainer of scrcpy.

If you appreciate this application, you can support my open source work: - GitHub Sponsors - Liberapay - PayPal

License

Copyright (C) 2018 Genymobile
Copyright (C) 2018-2026 Romain Vimont

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extension points exported contracts — how you extend this code

AsyncProcessor (Interface)
(no doc) [9 implementers]
server/src/main/java/com/genymobile/scrcpy/AsyncProcessor.java
AudioCapture (Interface)
(no doc) [4 implementers]
server/src/main/java/com/genymobile/scrcpy/audio/AudioCapture.java
OpenGLFilter (Interface)
(no doc) [2 implementers]
server/src/main/java/com/genymobile/scrcpy/opengl/OpenGLFilter.java
Codec (Interface)
(no doc) [2 implementers]
server/src/main/java/com/genymobile/scrcpy/model/Codec.java
VirtualDisplayListener (Interface)
(no doc) [2 implementers]
server/src/main/java/com/genymobile/scrcpy/video/VirtualDisplayListener.java

Core symbols most depended-on inside this repo

e
called by 97
server/src/main/java/com/genymobile/scrcpy/util/Ln.java
sc_mutex_unlock
called by 91
app/src/util/thread.c
sc_mutex_lock
called by 59
app/src/util/thread.c
getWidth
called by 37
server/src/main/java/com/genymobile/scrcpy/model/Size.java
acute
called by 36
server/src/main/java/com/genymobile/scrcpy/control/KeyComposition.java
get
called by 35
server/src/main/java/com/genymobile/scrcpy/control/PointersState.java
getHeight
called by 35
server/src/main/java/com/genymobile/scrcpy/model/Size.java
sc_mutex_destroy
called by 34
app/src/util/thread.c

Shape

Function 866
Method 823
Class 752
Enum 195
Interface 10

Languages

C46%
Java35%
C++18%

Modules by API surface

app/src/cli.c86 symbols
app/src/input_manager.c72 symbols
server/src/main/java/com/genymobile/scrcpy/Options.java66 symbols
app/src/scrcpy.c66 symbols
app/src/screen.c55 symbols
app/src/server.c44 symbols
app/src/options.h43 symbols
app/src/input_events.h41 symbols
server/src/main/java/com/genymobile/scrcpy/control/ControlMessage.java40 symbols
app/src/recorder.c39 symbols
app/src/adb/adb.c36 symbols
server/src/main/java/com/genymobile/scrcpy/control/Controller.java35 symbols

For agents

$ claude mcp add scrcpy \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact