Skip to content

Debugging Workflow

This guide covers the full debugging toolkit — from streaming live logs to capturing visual evidence and running accessibility audits.

Capture real-time logs while reproducing a bug:

“Stream logs from iPhone 16 for 15 seconds, filtering for my app’s subsystem”

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"predicate": "subsystem == \"com.example.weatherapp\"",
"timeout": 15
}

Review what happened in the last 5 minutes:

“Collect the last 5 minutes of logs from the iPhone 16 simulator”

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"last": "5m",
"predicate": "subsystem == \"com.example.weatherapp\""
}

Use JSON output for structured analysis:

“Collect the last 2 minutes of error logs from the simulator in JSON format”

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"last": "2m",
"predicate": "level >= error",
"style": "json"
}

Capture the current screen state:

  1. Basic screenshot

    “Take a screenshot of the running simulator”

    The screenshot is saved as PNG with an auto-generated path:

    Screenshot saved to /tmp/screenshot-20250223-143052.png
  2. Screenshot to specific path

    “Take a screenshot and save it to ~/Desktop/bug-report.png”

    {
    "deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
    "outputPath": "/Users/dev/Desktop/bug-report.png"
    }

Record a video of the bug reproduction:

“Record the simulator screen for 20 seconds”

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"duration": 20,
"outputPath": "/Users/dev/Desktop/bug-demo.mp4"
}

Compare your app in both appearances:

  1. Set light mode and screenshot

    “Set the simulator to light mode and take a screenshot”

    // device_appearance
    { "deviceId": "F3A1B2C3...", "appearance": "light" }
    // screenshot
    { "deviceId": "F3A1B2C3...", "outputPath": "/tmp/light-mode.png" }
  2. Set dark mode and screenshot

    “Now switch to dark mode and take another screenshot”

    // device_appearance
    { "deviceId": "F3A1B2C3...", "appearance": "dark" }
    // screenshot
    { "deviceId": "F3A1B2C3...", "outputPath": "/tmp/dark-mode.png" }

Or do it all at once:

“Take screenshots of my app in both light mode and dark mode”

Run an automated accessibility check on the current screen:

“Run an accessibility audit on the iPhone 16 simulator”

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789"
}

Example output:

Accessibility Audit Results:
[Warning] Button "Submit" — Missing accessibility label
[Warning] Image "hero-banner" — Missing accessibility description
[Pass] Navigation bar — Proper heading hierarchy
[Pass] Text fields — Correct input traits
[Pass] Color contrast — Meets WCAG AA standards
2 warnings, 0 errors

Test location-dependent features:

  1. Set a GPS location

    “Set the simulator location to Apple Park”

    {
    "deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
    "latitude": 37.3349,
    "longitude": -122.0090
    }
  2. Launch your map feature and screenshot

    “Launch the app, wait a moment, then take a screenshot”

  3. Clear the location when done

    “Clear the simulated location”

Common test coordinates:

LocationLatitudeLongitude
Apple Park, Cupertino37.3349-122.0090
Times Square, NYC40.7580-73.9855
Tower of London51.5081-0.0759
Sydney Opera House-33.8568151.2153
Tokyo Tower35.6586139.7454

Here’s a complete debugging workflow in one conversation:

“I’m debugging a crash in my weather app. Here’s what I need:

  1. Stream logs for 10 seconds while I reproduce the crash
  2. Collect the last 2 minutes of error logs
  3. Take a screenshot of the crash state
  4. Run an accessibility audit
  5. Record 15 seconds of video showing the issue”

The AI assistant will execute each tool in sequence, providing all the diagnostic data you need.