Scrcpy 虚拟显示
在 Scrcpy 中新建虚拟显示
Section titled “在 Scrcpy 中新建虚拟显示”镜像一个新的虚拟显示而非设备主屏幕:
scrcpy --new-display=1920x1080scrcpy --new-display=1920x1080/420 # force 420 dpiscrcpy --new-display # use the main display size and densityscrcpy --new-display=/240 # use the main display size and 240 dpi退出时会销毁该虚拟显示。
在部分设备上,虚拟显示中会提供一个启动器(launcher)。
当没有启动器(或通过 --no-vd-system-decorations 显式禁用了系统装饰)时,虚拟显示会是空白。此时需要启动一个 Android 应用。
例如:
scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc应用本身也可能是一个启动器。例如,运行开源的 Fossify Launcher:
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-contentIME 策略
Section titled “IME 策略”默认情况下,虚拟显示的输入法(IME)会出现在默认显示上。
要让其显示在本地显示上,使用 --display-ime-policy=local:
scrcpy --display-id=1 --display-ime-policy=localscrcpy --new-display --display-ime-policy=local