Agent Skillsn0an/VivaDicta › ios-log-capture

ios-log-capture

GitHub

提供iOS模拟器及真机控制台日志捕获指南,支持结构化日志与print输出,辅助调试、测试和监控。

.agents/skills/ios-log-capture/SKILL.md n0an/VivaDicta

Trigger Scenarios

需要捕获iOS应用日志进行调试 排查模拟器或真机上的运行时问题

Install

npx skills add n0an/VivaDicta --skill ios-log-capture -g -y
More Options

Non-standard path

npx skills add https://github.com/n0an/VivaDicta/tree/main/.agents/skills/ios-log-capture -g -y

Use without installing

npx skills use n0an/VivaDicta@ios-log-capture

指定 Agent (Claude Code)

npx skills add n0an/VivaDicta --skill ios-log-capture -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": "ios-log-capture",
    "description": "Reference guide for capturing console logs from iOS apps in Simulator or physical devices using native logging tools"
}

iOS Log Capture

Use this skill when you need to capture console logs from iOS apps running in Simulator or on physical devices for debugging, testing, or monitoring purposes.

Related Skills

Logging Methods

1. Simulator Structured Logging

Use start-logs to begin capture and stop-logs to summarize or filter the latest simulator log file.

Best for:

  • Fast local debugging
  • Real-time monitoring while the app stays open
  • Reviewing Logger output with timestamps, categories, and metadata

How it works:

  1. start-logs runs ./scripts/launch_simulator.sh in a long-lived shell session
  2. xcrun simctl spawn ... log stream writes to logs/sim-YYYYMMDD-HHMMSS.log
  3. stop-logs stops the active stream and summarizes or filters the latest file

Captures:

  • Logger output with subsystem filtering
  • Timestamps, categories, and thread metadata
  • Emojis and special characters

Does not capture:

  • print() output

2. Device Print Logging

Use start-logs-device to launch the app on a physical device with ENABLE_PRINT_LOGS=1, then use stop-logs-device to stop the session and inspect the newest log file.

Best for:

  • Capturing print() output on real hardware
  • Device-only issues where Console or Simulator does not reproduce the bug
  • Reviewing stdout and stderr in real time

How it works:

  1. start-logs-device runs ./scripts/launch_device.sh in a long-lived shell session
  2. xcrun devicectl device process launch --console streams output into logs/device-YYYYMMDD-HHMMSS.log
  3. stop-logs-device stops the active session and summarizes the newest file

Captures:

  • print() output enabled through ENABLE_PRINT_LOGS=1
  • stdout and stderr
  • Any mirrored log text emitted by LoggerExtension

3. Device Structured Logging

Use start-logs-device-structured to record a start timestamp and device UDID, then use stop-logs-device-structured to guide the user through running ./scripts/collect_device_logs.sh.

Best for:

  • Production-style debugging
  • Full .logarchive capture with later re-analysis in Console.app
  • Rich filtering by subsystem, category, and message type

How it works:

  1. start-logs-device-structured stores the current timestamp and device UDID in llmtemp/
  2. The user reproduces the issue on device
  3. stop-logs-device-structured asks the user to run ./scripts/collect_device_logs.sh
  4. The script runs sudo log collect, writes logs/vivadicta_device_*.logarchive, and extracts logs/device_*.txt

Captures:

  • Full structured logs with metadata
  • Reopenable .logarchive artifacts
  • A filtered text export for quick analysis

Quick Start

Simulator

  1. Run the start-logs skill.
  2. Interact with the app in the Simulator.
  3. Run the stop-logs skill.
  4. Optionally pass a filter such as errors, warnings, all, or a search term.

Device Print Logging

  1. Run the start-logs-device skill.
  2. Reproduce the issue on the connected device.
  3. Stop the active shell session or otherwise end the devicectl stream.
  4. Run the stop-logs-device skill.

Device Structured Logging

  1. Run the start-logs-device-structured skill.
  2. Reproduce the issue on the connected device.
  3. Run the stop-logs-device-structured skill.
  4. Follow the prompt to run ./scripts/collect_device_logs.sh interactively.

Manual Analysis Commands

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

# Inspect recent device print logs
ls -lt logs/device-*.log | head -5
grep -i "error" logs/device-*.log

# Inspect structured device archives
log show logs/vivadicta_device_*.logarchive \
  --predicate 'subsystem == "com.antonnovoselov.VivaDicta"'

Notes

  • VivaDicta primarily uses structured logging through Logger, so simulator logging is usually the fastest high-signal option.
  • Device print logging depends on ENABLE_PRINT_LOGS=1 and is best for flows where mirrored print output is useful.
  • Structured device logging is slower, but it preserves the most context and is best for hard-to-reproduce issues.
  • Use the screenshot skill to capture visual state while reproducing a bug.

Version History

  • c5601d4 Current 2026-07-25 08:15

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-simulator-skill/SKILL.md
.agents/skills/krankie-audit/SKILL.md
.agents/skills/krankie-rankings/SKILL.md
.agents/skills/loc-report/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
fbf9c91
Hash
6912924e
Indexed
2026-07-25 08:15

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 14:17
浙ICP备14020137号-1 $방문자$