ios-watch-logs

majiayu000's avatarfrom majiayu000

Start real-time log streaming from connected iPhone to console and file. Shows only app's explicit log messages with [APP] prefix. Use when monitoring app behavior, debugging, or viewing logs.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 5, 2026

When & Why to Use This Skill

The iOS Watch Logs skill enables real-time log streaming from a USB-connected iPhone directly to your console or file. By leveraging `pymobiledevice3` and filtering for specific `[APP]` prefixes, it provides a clean, focused view of application behavior, making it an essential tool for mobile developers to debug and monitor iOS apps efficiently without the noise of system-level logs.

Use Cases

  • Live Debugging: Stream and monitor application logs in real-time to quickly identify and resolve runtime errors on physical iOS devices during the development phase.
  • Behavioral Analysis: Use the specialized `[APP]` prefix filter to isolate application-specific logic from thousands of system messages, allowing for clear observation of app state changes.
  • Network & UI Monitoring: Track network responses, API interactions, and UI lifecycle events as they happen to ensure smooth user experiences and data integrity.
  • Log Documentation: Capture live log streams into files or snapshots for comprehensive post-session analysis, remote troubleshooting, and detailed bug reporting.
nameios-watch-logs
descriptionStart real-time log streaming from connected iPhone to console and file. Shows only app's explicit log messages with [APP] prefix. Use when monitoring app behavior, debugging, or viewing logs.

iOS Watch Logs

Overview

Streams logs from a USB-connected iPhone in real-time using pymobiledevice3, filtering to show only the app's explicit log messages (those with [APP] prefix).

When to Use

Invoke this skill when the user:

  • Asks to "watch iOS logs"
  • Wants to "see what the app is doing"
  • Says "monitor the iPhone"
  • Asks to "stream logs from iPhone"
  • Wants to debug or see real-time app behavior
  • Says "show me the logs"

Prerequisites

  • iPhone connected via USB
  • pymobiledevice3 installed (pip3 install pymobiledevice3)
  • Device must be trusted
  • App must be running on the device to see logs

The iPhone screen capture app has an integrated console:

cd miso/platforms/ios/development/screen-capture/imp
./iphone_screencap.sh

Click the ">" button to open the live log console.

Option 2: Terminal Streaming

Stream logs directly in terminal:

pymobiledevice3 syslog live 2>/dev/null | grep "\[APP\]"

Option 3: Claude Reading Logs

Claude can read recent logs with:

timeout 3 pymobiledevice3 syslog live 2>/dev/null | grep "\[APP\]" | tail -30

Log Format

The app's Logger class prefixes messages with [APP]:

NoobTest{...}[12345] <INFO>: [APP] [PostView] Loading post 14
NoobTest{...}[12345] <DEBUG>: [APP] [Network] Response: 200 OK

Adding Logs in Code

Use the app's Logger class in Swift:

Logger.shared.info("[MyFeature] Something happened")
Logger.shared.debug("[MyFeature] Debug info: \(value)")
Logger.shared.error("[MyFeature] Error: \(error)")

Common Issues

No logs appearing:

  • Ensure the app is running on the device
  • Check that logs use [APP] prefix
  • Verify pymobiledevice3 is installed: pip3 install pymobiledevice3
  • Device must be trusted and unlocked

pymobiledevice3 not found:

  • Install: pip3 install pymobiledevice3

Only system logs showing:

  • The app's Logger must prefix messages with [APP]
  • This filters out thousands of framework/system messages

Notes

  • The [APP] prefix filters out thousands of system messages
  • Screen capture app console auto-scrolls to latest logs
  • Use timeout command to get a snapshot without blocking