Debug like a Pro v2

🇳🇱 Appdevcon on 14 Mar 2019
iOS debugging Xcode LLDB

The majority of engineers either debug using print()/NSLog, or utilise debugger for po command and ordinary breakpoints. However, Xcode and its debug tools give way more power, starting from the LLDB command language and runtime breakpoints logging to Instruments for performance and CPU investigations. I will cover the best practices, talk about most recent changes from WWDC 2018 and show quite a few examples, where meaningless at a first sight error message can be expanded to a call to action using proper debug tools. By the end of the talk, everyone should learn how to debug like a pro.

About this talk

What does this talk cover?

Xcode debugging beyond print() and po: the LLDB command language, breakpoints that log at runtime instead of stopping, and Instruments for CPU and performance investigations - with examples of turning a vague error message into something you can act on.

Which LLDB commands does it cover?

It builds up from expression and po to breakpoints that evaluate Swift mid-run, demonstrated on a JSON-digging po session that will look familiar.

What's the 'measure your debugging' part about?

What you can measure, you can manage: the talk includes trackmecode, a small open-source script that hooks Xcode's build, test, and run behaviours so you can see how much time the modify-compile-run loop costs you in a week.

Where can I watch the talk or get the slides?

The recording from Appdevcon 2019 is embedded at the top of this page, and the slide deck (PDF) is in the resources section.

Related consulting

When an app is slow or crashing in production, this is what I get hired to fix - Instruments traces included.

App Performance & Crashes