跳转到内容

Scrcpy 虚拟显示

镜像一个新的虚拟显示而非设备主屏幕:

Terminal window
scrcpy --new-display=1920x1080
scrcpy --new-display=1920x1080/420 # force 420 dpi
scrcpy --new-display # use the main display size and density
scrcpy --new-display=/240 # use the main display size and 240 dpi

退出时会销毁该虚拟显示。

在部分设备上,虚拟显示中会提供一个启动器(launcher)。

当没有启动器(或通过 --no-vd-system-decorations 显式禁用了系统装饰)时,虚拟显示会是空白。此时需要启动一个 Android 应用

例如:

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

应用本身也可能是一个启动器。例如,运行开源的 Fossify Launcher

Terminal window
scrcpy --new-display=1920x1080 --no-vd-system-decorations --start-app=org.fossify.home

默认情况下,虚拟显示的系统装饰是启用的。要禁用它们,使用 --no-vd-system-decorations

scrcpy --new-display --no-vd-system-decorations

这对某些设备很有用,它们可能会显示异常的 UI,或用于禁用虚拟显示中默认的启动器 UI。

请注意,如果未启动任何应用,将不会渲染内容,因此不会产出任何视频帧。

默认情况下,当关闭虚拟显示时,正在运行的应用会被销毁。

如需将其转移到主显示而非销毁,使用:

scrcpy --new-display --no-vd-destroy-content

默认情况下,虚拟显示的输入法(IME)会出现在默认显示上。

要让其显示在本地显示上,使用 --display-ime-policy=local

Terminal window
scrcpy --display-id=1 --display-ime-policy=local
scrcpy --new-display --display-ime-policy=local