Debugging Workflow
This guide covers the full debugging toolkit — from streaming live logs to capturing visual evidence and running accessibility audits.
Log Analysis
Section titled “Log Analysis”Stream Live Logs
Section titled “Stream Live Logs”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}Collect Historical Logs
Section titled “Collect Historical Logs”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"}Visual Debugging
Section titled “Visual Debugging”Screenshots
Section titled “Screenshots”Capture the current screen state:
-
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 -
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"}
Screen Recording
Section titled “Screen Recording”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"}Dark Mode Testing
Section titled “Dark Mode Testing”Compare your app in both appearances:
-
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" } -
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”
Accessibility Audit
Section titled “Accessibility Audit”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 errorsLocation Testing
Section titled “Location Testing”Test location-dependent features:
-
Set a GPS location
“Set the simulator location to Apple Park”
{"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789","latitude": 37.3349,"longitude": -122.0090} -
Launch your map feature and screenshot
“Launch the app, wait a moment, then take a screenshot”
-
Clear the location when done
“Clear the simulated location”
Common test coordinates:
| Location | Latitude | Longitude |
|---|---|---|
| Apple Park, Cupertino | 37.3349 | -122.0090 |
| Times Square, NYC | 40.7580 | -73.9855 |
| Tower of London | 51.5081 | -0.0759 |
| Sydney Opera House | -33.8568 | 151.2153 |
| Tokyo Tower | 35.6586 | 139.7454 |
Full Debug Session Example
Section titled “Full Debug Session Example”Here’s a complete debugging workflow in one conversation:
“I’m debugging a crash in my weather app. Here’s what I need:
- Stream logs for 10 seconds while I reproduce the crash
- Collect the last 2 minutes of error logs
- Take a screenshot of the crash state
- Run an accessibility audit
- Record 15 seconds of video showing the issue”
The AI assistant will execute each tool in sequence, providing all the diagnostic data you need.
Next Steps
Section titled “Next Steps”- Simulator Management — Set up multiple test environments
- Device & Debug Prompts — Ready-to-use debugging prompts