Foreword¶
DeepSeek Harness (DSH) adopts a plugin-based architecture, aiming to let various device capabilities plug in through standard interfaces. In Android development or automation scenarios, developers need to view the device screen in real time and perform actions such as clicking and swiping. This article introduces ns-zzj/dsh-android-scrcpy, which serves as DSH’s Android screen-mirroring provider. It is responsible for establishing connections through ADB and the scrcpy protocol, and transmitting device video and control commands back to the host.
What is This¶
This is a DSH Provider package specifically responsible for “connection” and “transmission” on the Android platform. It does not include the UI, AI tools, or logic decisions; these are provided by the dependent dsh-scrcpy-core.
- Role positioning: Android platform transmission Provider.
- Dependency:
dsh-scrcpy-coremust be installed to activate this package. Neither automatically pulls the other; both must be installed manually. - Transport method: via
adbconnection, supporting USB debugging or paired wireless debugging. - Protocol: uses the scrcpy-server 4.1 protocol, with two sockets: video and control.
Core Features¶
This plugin processes video unpacking directly on the stream path, maintains GOP cache, and pushes it to the browser half-pane.
- Cross-platform multi-device support: supports simultaneous display of Android and HarmonyOS devices, each with independent sessions. Actions affect only the currently focused device, preventing accidental touches.
- UHID virtual external keyboard: converts the PC keyboard into a real HID peripheral for the device (sending true HID reports), rather than simple text injection.
- Screen rotation and page switching: after device rotation, the video follows automatically without reconnection; when switching away from the page, it pauses automatically and uses fewer resources; when returning, it resumes immediately, and rotation during the pause is supported.
- Video quality control: wired and wireless connections can be configured separately for scale ratio and frame rate (default wired 1/2·60fps, wireless 1/4·30fps, up to 120fps).
Installation and Activation¶
Install both packages in DSH’s plugin panel. The order does not matter, but both must be installed.
# 1. 安装 Core(含界面与 AI 工具)
@nszzj/dsh-scrcpy-core
# 2. 安装本包(安卓 Provider)
@nszzj/dsh-android-scrcpy
After installation, you must completely exit DSH and restart it for host-side changes to take effect. If only this package is installed without Core, the plugin will remain silently inactive due to unmet injection requirements.
Usage¶
- Device preparation: enable USB debugging on the device (or paired wireless debugging), and ensure
adb devicesrecognizes the device. - View device: In DSH’s top menu “Device List”, Core fetches device information every 3 seconds, and this package reports it.
- Configure connection: Open “Connection Settings”, configure the ADB path (if not in PATH) and video parameters (set scale and frame rate separately for wired/wireless).
Notes¶
- Permissions and confirmation: On first connection or when an authorization dialog appears, you must manually tap confirm on the device; the Provider cannot do it automatically.
- Configuration taking effect: scale and frame rate cannot be modified during a connection; disconnect and reconnect for changes to take effect.
- Environment requirements: No Java is required on the PC; scrcpy-server runs directly via the device-side
app_process. - Stream recovery: Recovery after stream interruption or moving to the background relies on the GOP resend mechanism; if the device-side does not output keyframes for a long time, recovery may be slower.