Agent Skillsn0an/VivaDicta › logs-start

logs-start

GitHub

启动 VivaDicta 应用日志捕获,支持模拟器、真机及结构化归档三种层级。用于收集调试日志以排查问题,配合 logs-stop 结束捕获。

.agents/skills/logs-start/SKILL.md n0an/VivaDicta

Trigger Scenarios

用户请求查看或捕获应用日志 需要调试应用运行时输出 排查键盘或扩展程序日志缺失问题

Install

npx skills add n0an/VivaDicta --skill logs-start -g -y
More Options

Non-standard path

npx skills add https://github.com/n0an/VivaDicta/tree/main/.agents/skills/logs-start -g -y

Use without installing

npx skills use n0an/VivaDicta@logs-start

指定 Agent (Claude Code)

npx skills add n0an/VivaDicta --skill logs-start -a claude-code -g -y

安装 repo 全部 skill

npx skills add n0an/VivaDicta --all -g -y

预览 repo 内 skill

npx skills add n0an/VivaDicta --list

SKILL.md

Frontmatter
{
    "name": "logs-start",
    "description": "Start a VivaDicta log capture. Defaults to the simulator; takes sim, device, or structured to pick a tier.",
    "disable-model-invocation": true
}

logs-start

Start a log capture. Stop it with logs-stop, which resolves the active tier on its own - you never have to name it again.

Argument

$ARGUMENTS selects the tier. Empty means sim.

Argument Tier Reaches extensions? Cost
(empty) or sim Simulator, live unified log yes (all sim processes) none
device Device, live stdout no, main app only none
structured Device, unified log archive yes interactive sudo, large archive

Anything else: say what was passed, list the three, and stop. Do not guess.

When invoked with no argument, start the simulator capture as usual, then close your report with this reminder so the other tiers stay discoverable:

Started the simulator capture (default). Other tiers: /logs-start device for live device stdout (main app only), /logs-start structured for the device unified log (the only tier that sees the keyboard and other extensions).

Do not ask which tier to use instead of starting - the default is the default. Only mention the alternatives after the capture is already running.

Choosing a tier

  • sim is the default because it is free and the richest: real unified-log metadata, timestamps, levels, categories, threads.
  • device is for hardware-only bugs. Live and cheap, but see the limitation below - it cannot see the keyboard or any other extension.
  • structured is the only tier that sees extensions on hardware. Reach for it when the keyboard, share, action, or widget target is involved, or for a post-mortem .logarchive you want to reopen in Console.app.

sim

  1. mkdir -p logs
  2. Run ./scripts/launch_simulator.sh in a background/long-lived shell so log stream keeps running.
  3. Report the logs/sim-YYYYMMDD-HHMMSS.log path the script prints.

Attaches to the already-booted Simulator; it does not relaunch the app, and it fails if none is booted. Captures Logger output filtered to subsystem == "com.antonnovoselov.VivaDicta"; raw print() is not included.

device

  1. ./scripts/launch_device.sh --check first - it resolves device and bundle id without launching. Fix whatever it reports before continuing.
  2. mkdir -p logs
  3. Run ./scripts/launch_device.sh in a background/long-lived shell.
  4. Report the logs/device-YYYYMMDD-HHMMSS.log path.

Uses xcrun devicectl device process launch --console with ENABLE_PRINT_LOGS=1. --terminate-existing restarts the app, so in-progress state is lost.

Limitation: main app only, no extensions

--console pipes the stdout of the single process devicectl launched. Every extension runs in its own system-spawned process, so devicectl never sees it. Their output is absent entirely and nothing says so - you get a complete-looking stream that is silently missing a target.

Measured: a capture during keyboard use carried 213 lines from VivaDicta/ and 0 from VivaDictaKeyboard/, though the keyboard logs from KeyboardViewController, KeyboardTextProcessor and VivaModeManager. Use structured for extensions.

Timestamps

Lines carry time, level and call site, because LoggerExtension's print mirror stamps them itself:

19:09:40.709 [INFO] VivaDicta/AIService.swift:666 Loaded 1 Viva Modes

That is app-side, so it only appears in builds you install. Bare, unstamped lines mean the installed binary predates the print mirror - rebuild to the device rather than changing the capture. Category and thread are still absent; stdout has no room for unified-log metadata.

structured

Starts nothing - it only records where to collect from. logs-stop does the work.

  1. Find the device:
    xcrun xctrace list devices | grep iPhone | grep -v Simulator | head -1
    
  2. mkdir -p llmtemp
  3. date '+%Y-%m-%d %H:%M:%S' > llmtemp/.device-log-start-time
    echo "<UDID>" > llmtemp/.device-log-udid
    
  4. Report the start time and UDID, and warn that logs-stop will need interactive sudo and will write a large archive.

Why this tier reaches extensions: sudo log collect --device-udid pulls the device's whole unified log, and extension lines survive the subsystem filter because LoggerExtension.swift hardcodes one subsystem across all targets:

private nonisolated let kLoggingSubsystem = "com.antonnovoselov.VivaDicta"

That constant is load-bearing. If a target is ever changed to log under its own bundle id, it disappears from these captures silently.

Concurrent captures

sim and device can run at once; logs-stop handles all active tiers. Do not start a second capture of the same tier - the first one's file stops receiving the lines you expect.

Manual analysis

ls -lt logs/sim-*.log | head -5
grep -i "error\|fault" logs/sim-*.log
grep "\[AppState\]" logs/sim-*.log

log show logs/vivadicta_device_*.logarchive \
  --predicate 'subsystem == "com.antonnovoselov.VivaDicta"'

Related

Version History

  • fbbdfe0 Current 2026-09-09 09:13

Same Skill Collection

.agents/skills/analyze-unrecognized-apps/SKILL.md
.agents/skills/app-container-group/SKILL.md
.agents/skills/app-container/SKILL.md
.agents/skills/asc-aso-audit/SKILL.md
.agents/skills/asc-aso-rankings/SKILL.md
.agents/skills/asc-localize-metadata/SKILL.md
.agents/skills/asc-metadata-sync/SKILL.md
.agents/skills/asc-release-flow/SKILL.md
.agents/skills/asc-whats-new-writer/SKILL.md
.agents/skills/axe-simulator-control/SKILL.md
.agents/skills/coverage-report/SKILL.md
.agents/skills/diagram/SKILL.md
.agents/skills/ios-log-capture/SKILL.md
.agents/skills/ios-simulator-skill/SKILL.md
.agents/skills/krankie-audit/SKILL.md
.agents/skills/krankie-rankings/SKILL.md
.agents/skills/loc-report/SKILL.md
.agents/skills/logs-stop/SKILL.md
.agents/skills/pr/SKILL.md
.agents/skills/prcdx/SKILL.md
.agents/skills/release-prepare/SKILL.md
.agents/skills/screenshot/SKILL.md
.agents/skills/simulator-screenshot-time/SKILL.md
.agents/skills/spm-build-analysis/SKILL.md
.agents/skills/start-logs-device-structured/SKILL.md
.agents/skills/start-logs-device/SKILL.md
.agents/skills/start-logs/SKILL.md
.agents/skills/stop-logs-device-structured/SKILL.md
.agents/skills/stop-logs-device/SKILL.md
.agents/skills/stop-logs/SKILL.md
.agents/skills/swift-concurrency-pro/SKILL.md
.agents/skills/swift-testing-pro/SKILL.md
.agents/skills/swiftdata-pro/SKILL.md
.agents/skills/swiftui-liquid-glass/SKILL.md
.agents/skills/swiftui-performance-audit/SKILL.md
.agents/skills/swiftui-pro/SKILL.md
.agents/skills/xcode-build-benchmark/SKILL.md
.agents/skills/xcode-build-fixer/SKILL.md
.agents/skills/xcode-build-orchestrator/SKILL.md
.agents/skills/xcode-compilation-analyzer/SKILL.md
.agents/skills/xcode-project-analyzer/SKILL.md
.agents/skills/xcodebuild-testing/SKILL.md
.agents/skills/commit-push/SKILL.md

Metadata

Files
0
Version
fbbdfe0
Hash
5589b0cc
Indexed
2026-09-09 09:13

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-17 07:18
浙ICP备14020137号-1