-
Notifications
You must be signed in to change notification settings - Fork 8
URL Scheme Automation
Screen Remote 通过可浏览的 screen-remote:// URL Scheme 接收外部应用、AI 或 MCP 工具发起的导航、会话、设备管理和设置操作。入口由 app/MainActivity.kt 与 app/deeplink/ 拥有;MainActivity 使用 singleTask,冷启动和已运行实例都会解析新 Intent。
- 会话 selector 按大小写敏感的 session id、第一条同名 session、合法的
host:port临时目标依次解析。IPv6 endpoint 必须包含方括号并进行 URL 编码。 -
scrcpyURL 会复制已保存会话的有效 profile 配置,只覆盖 URL 明确给出的字段,然后创建内存运行会话;不会修改已保存会话或 profile。 - 直接使用 endpoint 时创建临时 TCP 会话。管理 URL 同样可使用已保存会话或临时 endpoint。
- 新建会话 URL 只预填编辑器,仍由用户确认保存。命令管理 URL 只预填命令,不自动执行。
| 目的 | URL 形式 |
|---|---|
| 会话 / 操作页 |
screen-remote://open/sessions、screen-remote://open/actions
|
| 设置页 | `screen-remote://open/settings[/about |
| 新建 / 编辑会话 |
screen-remote://session/new?...、screen-remote://session/edit/{selector}
|
| 启动远控 | screen-remote://session/{selector}/scrcpy?... |
| 打开设备管理 | `screen-remote://session/{selector}/manage/{device |
| 文件路径 / 命令预填 | 在 file 路由后追加编码路径,或给 command 路由传 command=
|
| 修改全局设置 | screen-remote://setting/{setting}/{value} |
| ADB / 诊断 / 断开 |
screen-remote://adb/keys/generate、screen-remote://diagnostics/logs、screen-remote://remote/disconnect
|
新建会话参数包括 name、address、color、profileId、useProfileDefaults、逗号分隔的 backupAddresses 与 groupIds,也可同时携带远控参数。
远控 URL 支持:
maxSize、videoBitRate、maxFps、videoEncoder、videoDecoder、audio、audioBitRate、audioEncoder、audioDecoder、gameMode、compatibilityMode、fullScreen、floatingBall、hardwareDecoding、followOrientation、clipboard、turnScreenOff、powerOffOnClose、cleanupOnDisconnect、stayAwake、keepDeviceAwake、showTouches、ignoreVideoEncoderConstraints、displayId、newDisplayEnabled、newDisplay、virtualDisplaySystemDecorations、preserveVirtualDisplayContent、startApp、codecOptions 与 tunnelMode。
兼容别名为 enableAudio、useFullScreen、showFloatingBall、enableHardwareDecoding、followRemoteOrientation、clipboardSync。参数名忽略大小写并归一到权威名称;路由、selector 和枚举值保持大小写敏感。布尔值接受 on/true/1/yes 与 off/false/0/no。开启 compatibilityMode 后,音频与自动剪贴板同步始终关闭。
可修改的全局设置为 debugmode、activitylog、audiolog、videolog、controllog、eventlog、shelllog、managementlog、haptic、performancestats、autoupdate、updatechannel、theme 与 language。枚举值分别为 stable|prerelease、system|light|dark、auto|chinese|english。
- Scheme、host、路径和未知参数使用白名单;URL authority 不接受 credentials、port 或 fragment。
- 外部调用者必须对路径段、endpoint、文件路径、命令和查询值做 UTF-8 URL 编码。
- 不支持或不合法的 URL 只记录英文警告,不执行部分操作。
- Debug 构建额外暴露受系统
android.permission.DUMP保护的只读 diagnostics provider,可读取设备、会话、socket、codec、日志、指标和动态 URL catalog;release 构建不包含该 provider。
-
app/deeplink/ScreenRemoteDeepLink.kt、ScrcpyUrlParameters.kt、UrlRuntimeSession.kt -
feature/session/ui/MainScreen.kt、feature/session/viewmodel/MainViewModel.kt -
ScreenRemoteDeepLinkTest、ScrcpyUrlParametersTest、UrlRuntimeSessionTest
- 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. / 技术主题仅在完成逐页审核后加入侧边栏。