Skip to content

Architecture

星冉 edited this page Jul 21, 2026 · 1 revision

Architecture Documentation

中文

This documentation group defines Screen Remote's stable system boundaries and explains how a remote-control session moves from configuration through cleanup. Directory names are navigation aids; source code, tests, and build configuration remain the current sources of truth.

Reading path

  1. Module Map and Boundaries: repository boundaries, the five code layers, dependency direction, code placement, and architecture principles.
  2. Runtime Main Path: ADB, server startup, sequential socket connection, metadata, decoders, and cleanup.
  3. Session State and Events: session state, component snapshots, events, and diagnostic projections.
  4. Session Configuration and Connection Lifecycle: boundaries among persisted configuration, device capabilities, connection candidates, and runtime facts.

Core constraints

  • A session is the ownership boundary of the remote-control runtime. Low-level components and UI must not maintain competing session truths.
  • core provides stable models and foundations, infrastructure implements technical capabilities, feature organizes user scenarios, service coordinates system lifecycle, and app performs assembly.
  • ADB provides the device channel and command capabilities; scrcpy starts and maintains a remote-control session on top of them.
  • Configuration, device capabilities, and facts from the current run are represented separately.
  • Logs, monitoring, and statistics consume formal states and events; they do not become a second state machine.
  • scrcpy video, optional audio, and control sockets must be connected sequentially, never concurrently.

How to use this group

  • Before adding or moving code, use the ownership decisions in the module map.
  • When changing session flow, follow the runtime path and verify symmetry across startup, failure, and cleanup.
  • When changing state models, check events, component snapshots, UI projections, and tests together.
  • When changing connection strategy, distinguish persisted configuration, candidates, transport identity, and the current attempt.

This page is a stable entry point only. Concrete classes and flow details belong to their subject pages so that the same fact is not copied across multiple documents.

Clone this wiki locally