feat: add headless agent management to CLI and both desktop clients

This commit is contained in:
tongtong committed 2026-11-12 21:17:44 +08:00
1 parent e91fa0235c
commit 6916dd54fb
50 files changed
+4837 -148

No files matched your search

+16
View File
@@ -54,3 +54,19 @@ Get-Content "$env:LOCALAPPDATA\AndroidDeviceStreaming\agent\logs\agent.log" -Tai
Start-ScheduledTask -TaskName ADS-Agent
Stop-ScheduledTask -TaskName ADS-Agent
```
## Managed multi-phone Agent (0.2)
The deployed computer has migrated to Agent ID `home-pc` (家里电脑), retaining `home-phone` and its TCP endpoint. `ADS-Agent-home-pc` runs the native supervised Agent as SYSTEM at startup; the old `ADS-Agent` task is disabled. The migration keeps a timestamped backup under the protected Agent directory and restores the legacy files/task on failure. No reboot was performed.
`migrate-managed.ps1` migrates the earlier TCP single-phone installation. Stage the new binaries as `ads-agent.exe.new` and `adsctl.exe.new` in its directory, then run the script in an elevated PowerShell 7 terminal. It verifies the legacy task belongs to that directory before stopping it. Parameters customize directory, Agent ID, display name and old task name. New installations should use `adsctl init` and `adsctl service install` instead.
For current status and logs, use:
```powershell
& "$env:LOCALAPPDATA/AndroidDeviceStreaming/agent/adsctl.exe" status
& "$env:LOCALAPPDATA/AndroidDeviceStreaming/agent/adsctl.exe" logs --follow
Get-ScheduledTask -TaskName ADS-Agent-home-pc
```
The managed log buffer is in memory; the old runner log is historical. See [Agent management](../../docs/agent-management.md) for Linux and Windows headless setup, CLI commands, role credentials and both GUIs.