thiennc-tesoglobal/ios-skills/debugging-instruments
Claude Code and agent skill by thiennc-tesoglobal/ios-skills
- community
Checking that the SKILL.md file is still in the repository.
Debug iOS apps and profile performance using LLDB, the interactive Memory Graph Debugger, and Instruments. Use for crashes, retain-cycle inspection, hangs, build failures, and generic CPU, memory, energy, or network profiling. Use ios-memgraph-analysis for .memgraph capture, leaks CLI ownership paths, or persistent heap growth; use ios-ettrace-performance for ETTrace capture and JSON.
Install
npx vskill@latest install thiennc-tesoglobal/ios-skills/debugging-instrumentsSKILL.md
The same SKILL.md was published earlier as thiennc-tesoglobal/ios-skills/debugging-instruments.
Debugging and Instruments
Diagnose crashes, memory leaks, hangs, and performance bottlenecks using LLDB, Xcode Memory Graph Debugger, unified logging/signposts, and Instruments.
Scope Boundary: Route command-line.memgraphanalysis toios-memgraph-analysisand ETTrace tracing toios-ettrace-performance.
Contents
- LLDB Debugging Workflow
- Memory Graph & Retain Cycles
- Hangs & Signpost Diagnostics
- Instruments Profiling
- iOS 27 Updates
- Common Mistakes
- Review Checklist
- References
LLDB Debugging Workflow
Follow a structured, non-invasive triage loop:
- Reproduce in Debug configuration; pause at the narrowest relevant line.
- Inspect values without executing code using
v, falling back topoonly for formatted descriptions. - Traverse frames and threads to isolate invalid states.
- Set conditional breakpoints or watchpoints to catch unintended state transitions.
Memory Graph & Retain Cycles
Enable Malloc Stack Logging (Edit Scheme > Run > Diagnostics) to record allocation backtraces.
- Navigate to the suspect view, perform user actions, and pop/dismiss the view.
- Click Debug Memory Graph in the Xcode debug bar.
- Look for purple exclamation mark warnings indicating leaked memory or retain cycles.
- Select the instance node to inspect the strong reference graph.
Common fix: break closure cycles using [weak self] or assign delegates weakly (weak var delegate: SomeDelegate?).
Hangs & Signpost Diagnostics
Diagnose main thread stalls and measure execution intervals using unified logging and OSSignposter:
View intervals and subsystem events in Instruments under the os_signpost instrument.
Instruments Profiling
Always profile in Release configuration outside the debugger (Product > Profile):
- Time Profiler: Identifies hot execution paths and CPU usage. Expand invert-call-tree and hide-system-libraries to focus on app code.
- Allocations & Leaks: Tracks heap growth, memory allocations, and leaked memory over time.
- Core ML: Measures model execution latency, neural engine offload, and memory consumption.
- Energy Log / Network: Audits battery impact and network transfer efficiency.
iOS 27 Updates
- New instruments: Swift Executors and Foundation Models. System Trace unifies system calls, VM faults, and thread states.
- Swift Concurrency tracks are grouped into collections; tasks whose lifetimes began before the trace are shown.
xctrace recordaccepts recording options as JSON;xctrace exportgains time-range arguments and accepts.atrcand.logarchiveinput.- Neural Engine memory is attributed to the app and shows in the Allocations instrument.
- Organizer adds Hitches, Storage metrics, and AI-driven diagnostic analysis.
- Address Sanitizer may fail to launch on 27.0 OS targets when built with Xcode 26.4 or older; use Xcode 26.5 or later.
Sources: https://sosumi.ai/documentation/xcode-release-notes/xcode-27-release-notes, https://sosumi.ai/documentation/ios-ipados-release-notes/ios-ipados-27-release-notes
Common Mistakes
- Using `po` for simple inspection:
poevaluates expressions via the Swift runtime and can cause unexpected side effects or deadlocks. Usevto read values safely. - Profiling in Debug configuration: Debug builds disable compiler optimizations and produce distorted performance timings.
- Profiling with debugger attached: LLDB hooks introduce significant execution overhead. Use Instruments standalone.
- Ignoring purple warnings in Memory Graph: Purple warnings flag definite object leaks; resolve them before optimizing memory elsewhere.
- Blocking the main thread with synchronous work: Synchronous file I/O or network calls on
@MainActortrigger main-thread hangs.
Review Checklist
- [ ] LLDB inspection favors
voverpoto avoid side effects - [ ] Malloc Stack Logging enabled when capturing memory graphs
- [ ] Strong reference cycles broken with
[weak self]orweakdelegates - [ ] Profiling performed in Release build without debugger attachment
- [ ] Signposts implemented around performance-critical workflows
- [ ] Time Profiler call trees inspected with system libraries hidden
References
- LLDB command reference: references/lldb-patterns.md
- Instruments template guide: references/instruments-guide.md
- Logging (unified logging system)
- Logger
- OSSignposter
- Generating log messages from your code
- Recording performance data (signposts)
- Diagnosing memory, thread, and crash issues early
- Data races
- Reducing your app's memory use
- Improving your app's performance
- Improving app responsiveness
- Analyzing your app's battery use
- Analyzing the performance of your shipping app
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/debugging-instruments/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thiennc-tesoglobal/ios-skills/debugging-instruments)