ios-log-capture
GitHub提供iOS模拟器及真机控制台日志捕获指南,支持结构化日志与print输出,辅助调试、测试和监控。
Trigger Scenarios
Install
npx skills add n0an/VivaDicta --skill ios-log-capture -g -y
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
- See
start-logsandstop-logsfor simulator structured logging - See
start-logs-deviceandstop-logs-devicefor real-time device print logging - See
start-logs-device-structuredandstop-logs-device-structuredfor full device log archives - See
xcodebuild-testingfor running tests that may require log analysis - See
axe-simulator-controlfor automating simulator interactions before capturing logs
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
Loggeroutput with timestamps, categories, and metadata
How it works:
start-logsruns./scripts/launch_simulator.shin a long-lived shell sessionxcrun simctl spawn ... log streamwrites tologs/sim-YYYYMMDD-HHMMSS.logstop-logsstops the active stream and summarizes or filters the latest file
Captures:
Loggeroutput 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:
start-logs-deviceruns./scripts/launch_device.shin a long-lived shell sessionxcrun devicectl device process launch --consolestreams output intologs/device-YYYYMMDD-HHMMSS.logstop-logs-devicestops the active session and summarizes the newest file
Captures:
print()output enabled throughENABLE_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
.logarchivecapture with later re-analysis in Console.app - Rich filtering by subsystem, category, and message type
How it works:
start-logs-device-structuredstores the current timestamp and device UDID inllmtemp/- The user reproduces the issue on device
stop-logs-device-structuredasks the user to run./scripts/collect_device_logs.sh- The script runs
sudo log collect, writeslogs/vivadicta_device_*.logarchive, and extractslogs/device_*.txt
Captures:
- Full structured logs with metadata
- Reopenable
.logarchiveartifacts - A filtered text export for quick analysis
Quick Start
Simulator
- Run the
start-logsskill. - Interact with the app in the Simulator.
- Run the
stop-logsskill. - Optionally pass a filter such as
errors,warnings,all, or a search term.
Device Print Logging
- Run the
start-logs-deviceskill. - Reproduce the issue on the connected device.
- Stop the active shell session or otherwise end the
devicectlstream. - Run the
stop-logs-deviceskill.
Device Structured Logging
- Run the
start-logs-device-structuredskill. - Reproduce the issue on the connected device.
- Run the
stop-logs-device-structuredskill. - Follow the prompt to run
./scripts/collect_device_logs.shinteractively.
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=1and 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
screenshotskill to capture visual state while reproducing a bug.
Version History
- c5601d4 Current 2026-07-25 08:15


