-
Notifications
You must be signed in to change notification settings - Fork 8
Management Features
星冉 edited this page Jul 22, 2026
·
3 revisions
Management provides device-operation capabilities after ADB is established. It does not require a video Surface or the complete scrcpy session. Management availability does not prove remote-control availability; management failure should first be classified as transport, permission, command, parsing, or remote-capability failure.
SessionManagementSection defines seven sections:
| Section | Capabilities | Main boundary |
|---|---|---|
| DeviceInfo | System, display, storage, memory, battery, CPU, and network snapshot | Read-model aggregation; does not repair connections |
| Utility | Fixed wireless port, screenshot, reboot/power, app activation, DPI/resolution, animation, sleep/wake | Device-changing actions require confirmation and results |
| Files | Browse, upload/download, copy, move, rename, delete, preview/edit | Path quoting, permission, temporary local files, large-file lifetime |
| Apps | List, icons, details, launch, install/uninstall, clear data, export APK | Helper/cache use and dangerous-action confirmation |
| Process | Dynamic process list, search, memory, and termination | Dynamic snapshot, not static app-cache performance |
| PortForward | Saved session rules and active ADB forwards | Port conflicts, symmetric setup/removal, session ownership |
| Command | One-shot commands, presets, history, and interactive terminal | Ordinary command versus streaming shell and PTY lifetime |
- Pages reuse or create an exact transport-identity connection through
AdbConnectionManager. - One-shot work uses
AdbConnection.executeShell()orAdbShellManager; continuous output uses streaming or PTY APIs rather than polling to imitate a terminal. - Leaving the page currently retains an ADB connection protected by the foreground service; it does not imply automatic disconnect. A product change must implement this explicitly at entry and exit.
- scrcpy and management no longer switch based on a delayed-ACK product profile. One network connection assigns work between primary and streaming lanes.
- Device information is a
DeviceDashboardSnapshotaggregated from multiple commands; loading and error are part of the snapshot. - As soon as the management connection is ready,
SessionManagementDataProviderstarts three session-scoped warm-ups in parallel: the device dashboard, the/sdcardfile snapshot, and the default application-data request. The screen reuses those results instead of starting its first ADB request during composition. Each source is single-flight, and a failed request may be retried. - The device helper queries application attributes in batches using user/system, enabled/disabled, and field parameters; icons use a separate helper request. Only the current filter set is queried, with no per-app
pm path,dumpsys package, orstatcalls. Filter results, details, and icons remain cached for the management-page scope and are cleared when that scope exits. - The home summary uses one generic helper batch to collect multiple read-only sources without adding a dedicated helper API for every infrequent command. Each query and application field returns its value or an English error independently, so one failed item never aborts the batch.
- Every helper call uses one guard shell and a stable remote path on the target device. A missing remote JAR returns
DADB_HELPER_MISSING; otherwise the shell enters the helper throughinvoke <version> <request...>. A version mismatch returnsDADB_HELPER_VERSION_MISMATCH. The app overwrites the JAR only for these two states, then retries the original request once. Any helper protocol or behavior change must bump the helper version. - The prefetched
/sdcardfile snapshot is consumed once when Files first opens; later path loads read the requested directory again rather than retaining an unbounded per-directory cache. Manual or section refresh bypasses the ready state for only that section; refresh tokens are not shared across Files, Apps, Process, and PortForward. - App and file state is scoped to the selected session and released when the management screen is disposed; a cache key or completed background task must not leak across sessions or devices.
- Dynamic process, storage, and network data uses an explicit refresh token or trigger and must not execute unbounded commands on Compose recomposition.
- Lists are virtualized. Large results are parsed off the UI thread and committed as stable models.
- File, app, and process parsers should be testable pure functions; pages coordinate state and actions.
- The command page owns one reconnecting raw shell with keepalive, an unbounded de-duplicated history for the current management-screen lifetime, and explicit clear/close behavior. Up/down keys or controls navigate history.
- A new shell starts in
/sdcard. Tab or the Complete control requests case-insensitive command/path completion; repeated completion cycles candidates, and a unique directory match advances to its children. - Each submitted command appends a private completion marker carrying its exit status. The marker is buffered across fragmented reads, hidden from output, and rendered as a separator between commands.
- The toolbar and physical keyboard can send
Ctrl+C. Full-screen interactive programs such asvi,nano,less,screen, andtmuxare blocked because the raw shell does not provide their required terminal model; non-interactive and streaming commands such ascat,grep,sed, andtail -fremain allowed. - ANSI control sequences are removed. Output uses a fixed dark terminal palette, semantic success/warning/error tones, token highlighting, and the final
grep/rgpattern for match highlighting; these colors are presentation only and are not parsed as command state.
- Uninstall, clear data, process termination, file delete/overwrite, reboot, and power-off require an explicit target and confirmation.
- Shell arguments, paths, and package names use the quoting required by their command; raw user values must not become executable structure.
- Present the failure stage, exit or exception summary, and an actionable suggestion. Logs may contain redacted commands but not tokens, clipboard content, or private-file content.
- Connection closure cancels terminals, file transfer, and background loads. Old tasks must not update a page after the selected device changes.
-
SessionManagementAppSizeTest,SessionManagementFileTypeTest,SessionManagementFileCopyTest. -
SessionManagementNetworkInfoTest,SessionManagementProcessSearchTest. -
SessionManagementPortForwardSupportTest. -
SessionManagementAppSortTest: repeated sort selection toggles direction; title, size, and enabled-state comparators honor ascending/descending order. -
SessionManagementTerminalHighlightTest: semantic output, grep matches, hidden command markers/separators, completion, unsupported interactive commands, and session-lifetime history. - Device coverage for permission refusal, command failure, mid-operation disconnect, large directories/app lists, cancelled dangerous actions, and Android/ROM command differences.
- Overview / 总览
- Quick Start / 快速开始
- Connection & Pairing / 连接设备与配对
- Session Management / 会话管理
- Remote Control / 远程控制
- Settings / 设置
- Management Features / 管理功能
- FAQ / 常见问题
- Overview / 总览
- Technical Index / 技术文档索引
- Audit Checklist / 初始化与更新清单
- Conventions / 文档维护约定
- Architecture / 架构
- Module Map / 模块地图与边界
- Runtime Path / 运行时主链路
- Session State / 会话状态与事件
- Session Lifecycle / 会话配置与连接生命周期
- ADB, USB & Wireless / ADB、USB 与无线
- ADB Lifecycle / ADB 连接生命周期
- Pairing / 设备配对与无线调试
- Codecs / 编码与解码
- Remote Interaction / 远程交互性能与悬浮菜单
- Clipboard / 剪贴板同步
- Management / 管理功能
- Events & Shell / 事件、监控与 Shell
- Logging / 日志系统与维护
- Troubleshooting / 分层排障方法
- UI Design / UI 设计系统
- Bilingual Copy / 双语与文案
- Remote UI Analysis / 远程 UI 布局分析
- Engineering Rules / 工程与验证规则
- External Research / 外部研究与取舍
Technical topics appear here only after their page-level audit is complete. / 技术主题仅在完成逐页审核后加入侧边栏。