ITADN
Genymobile/scrcpy
README.md
以下内容由 AI 翻译,如有问题请点此提交 issue 反馈

[!WARNING] 此 GitHub 仓库(https://github.com/Genymobile/scrcpy)是该项目的唯一官方 来源。请勿从随机网站下载发布版本,即使 其名称中包含 scrcpy

scrcpy (v4.1)

scrcpy

发音为“screen copy

本应用镜像通过 USB 或 TCP/IP 连接的 Android 设备(视频和音频),并允许使用 计算机的键盘和鼠标进行控制。它不需要 root 权限或设备上 安装的应用程序。它适用于 LinuxWindowsmacOS

Linux  Windows  macOS 

screenshot

它专注于:

  • 轻量级:原生实现,仅显示设备屏幕
  • 性能:30~120fps,取决于设备
  • 画质:1920×1080 或更高
  • 低延迟35~70ms
  • 低启动时间:约 1 秒显示第一帧图像
  • 无侵入性:Android 设备上不会留下任何安装内容
  • 用户权益:无需账户、无广告、无需互联网
  • 自由:自由开源软件

其功能包括:

前提条件

Android 设备至少需要 API 21 (Android 5.0)。

音频转发 支持 API >= 30 (Android 11+)。

请确保已在您的设备上 启用 USB 调试

在某些设备(尤其是小米)上,您可能会遇到以下错误:

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

在这种情况下,你需要启用一个额外选项 USB debugging (Security Settings) (this is an item different from USB debugging) 来使用键盘和鼠标进行控制。设置此选项后,需要重启设备一次。

请注意,在 OTG 模式 下运行 scrcpy 不需要 USB 调试。

获取应用

必知技巧

使用示例

有很多选项,文档 在单独的页面中。 这里只是一些常见示例。

  • 以 H.265 捕获屏幕(质量更好),将尺寸限制为 1920,将帧率限制为 60fps,禁用音频,并通过模拟物理键盘控制设备:

    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
  • 在新的虚拟显示器中启动 VLC(与设备显示器分离):

    scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc
  • 使用 H.265 和 16 Mbps 的比特率,在新的 flex 显示器上启动 VLC, 同时保持显示器处于活动状态,使其不会关闭:

    scrcpy --new-display -x --keep-active --start-app=org.videolan.vlc --video-codec=h265 -b16M
  • 以 H.265 格式、1920x1080 分辨率录制设备摄像头(以及麦克风)到 MP4 文件:

    scrcpy --video-source=camera --video-codec=h265 --camera-size=1920x1080 --record=file.mp4
  • 捕获设备前置摄像头,并将其作为网络摄像头在计算机上暴露(在 Linux 上):

    scrcpy --video-source=camera --camera-size=1920x1080 --camera-facing=front --v4l2-sink=/dev/video2 --no-playback
  • 通过模拟物理键盘和鼠标来控制设备,而无需镜像(无需 USB 调试):

    scrcpy --otg
  • 使用插入计算机的游戏手柄控制设备:

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

用户文档

该应用提供了许多功能和配置选项。它们 在以下页面中有文档说明:

资源

文章

联系

您可以打开一个 issue 来报告 bug、请求功能或提出一般性问题。

对于 bug 报告,请先阅读 常见问题解答,您可能会立即找到 解决您问题的方案。

您还可以使用:

捐赠

我是 @rom1vscrcpy 的作者和维护者。

如果您喜欢这个应用程序,您可以支持我的开源 工作

许可证

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.