23.6 · Console, sysdiagnose and reproducing a bug
A bug you cannot reproduce is a bug you cannot fix. Most of the skill is recreating the user’s situation: their data, their settings, their network, their OS, and reading what the system recorded.
Mental model. Capture the environment, not just the steps: build, OS, flags, locale, network and data. Then make the environment something you can set on purpose.
What the device recorded
Console, the log command and sysdiagnose.
- What is a sysdiagnose, how do you use Console.app and the log command, and what should you ask a user or tester to send?
A sysdiagnose is a bundle of system diagnostic data gathered at one moment: the unified logs, crash and hang reports, process snapshots (spindumps), memory and…
Recreating the situation
Simulator tools, flags, seeded data and network conditions.
- How do you reproduce a bug reliably: environment, feature flags, seeded data, launch arguments, simulator tools and network conditions?
Start by writing down what could differ between your machine and the failure: the build (version, configuration, which commit), OS and device, the user’s…
More in Debugging & Instruments
- 23.1 · LLDB and breakpoints
- 23.2 · The view debugger, network inspection and memory bugs
- 23.3 · Sanitizers, and bugs that only appear in Release
- 23.4 · Unified logging: Logger, levels, privacy and reading logs back
- 23.5 · Crash reports, symbolication and a production diagnostics pipeline
- 23.7 · Schemes, test plans, simulators and derived data
- 23.8 · Reading sanitizer output, exit codes and runtime traps
- 23.9 · Diagnosing a hang, malloc debugging and leaks from the command line
- 23.10 · Demangling, atos and empty dSYMs, and log formatting