Files
AndroidDeviceStreaming/agent/README.md
T

17 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ads-agent(Rust 远程设备守护程序)
入口:`src/main.rs`。根目录构建:`cargo build -p ads-agent --release --locked`。
```powershell
$env:ADS_AGENT_TOKEN = '<设备端令牌>'
.\ads-agent.exe --server wss://devices.example.com --device home-phone --target 192.168.100.141:5555
```
默认主动出站,不需要对远程电脑开放入站端口。网络故障后以 1–30 秒退避重连,控制连接断开时结束旧数据连接。一个进程对应一台手机,多设备启动多个进程。
也可用 `--adb-server 127.0.0.1:5037 --adb-serial <序列号>` 替代 `--target`。该模式仍要求手机开启 TCP adbd(默认 5555,可用 `--device-port` 修改),不是通用的 USB-only 接入。
Windows 可由任务计划程序在登录后启动;Linux/macOS 可使用 `deploy/` 示例托管。当前二进制不是原生 Windows Service,不能直接用 `sc.exe create` 安装。
新版注册时协商 v2,按控制中心指令与本地客户端交换 WebRTC SDP,优先直连或连接独立中继;兼容控制中心下发的 v1 转发指令。无需增加手机或远程电脑的公网入站端口。控制连接丢失时会结束所属数据通道。