Blog Topics: Debugging, iOS, macOS, Instruments
Instruments Deep Dives
- Memory Graph Debugger walkthrough - Visual tool, screenshots > code
- Time Profiler: Finding the real bottleneck - Interpreting call trees, minimal code
- Allocations instrument: Tracking transient memory - Focus on using the tool
- Network Link Conditioner for testing slow connections - Configuration, not code
- Energy Log instrument for battery debugging - Interpreting graphs
Xcode Debugging Features
- View Hierarchy Debugger secrets - 3D view debugging, constraint issues
- Breakpoint actions beyond po - Log messages, sounds, shell commands
- Symbolic breakpoints for framework code - E.g., break on
UIViewAlertForUnsatisfiableConstraints
- Quick Look in debugger - Custom types with
debugQuickLookObject()
- Environment overrides - Dark mode, dynamic type, accessibility testing
Console/Logging
- OSLog vs print: Structured logging - Simple API, easy to test
- Console.app for device logs - Filtering, persistence
- signpost for measuring intervals - Small API surface
Crash Analysis
- Reading crash logs without symbolicating - Pattern recognition
- Common crash signatures and what they mean - Educational, examples from Apple docs
Moderate to Verify
- Thread Sanitizer findings explained - Show common warnings, fixes
- Address Sanitizer: Catching memory corruption - Requires triggering bugs
macOS-Specific
- Activity Monitor deep dive for devs - Energy, disk, network tabs
- Debugging sandboxing issues - Console filtering, entitlement errors
- Notarization troubleshooting -
spctl and codesign commands
Beginner Topics
Xcode Basics
- Your first breakpoint: Stop, inspect, continue - Basic breakpoint usage
- The Debug Area explained - Variables view, console, what each panel shows
- Print debugging done right - When and how to use
print() effectively
- Reading error messages in Xcode - Decoding red/yellow warnings
- Simulator tips every beginner should know - Shortcuts, reset, slow animations
Common Beginner Mistakes
- Why is my outlet nil? - IBOutlet connection issues
- “Thread 1: Fatal error” - What it means - Force unwrap crashes explained simply
- Why won’t my UI update? - Main thread basics
- “Use of unresolved identifier” - Scope and typos
- App crashes on launch - Info.plist issues, missing permissions
First Steps in Debugging
- Using
po in the console - Print object basics
- Step over, step into, step out - Debugger navigation
- Conditional breakpoints for beginners - Only break when something is true
- Inspecting variables without breakpoints - Quick Look, debug descriptions
- Console colors and what they mean - System messages vs your logs
Understanding Errors
- Optionals and nil: The #1 crash cause - Safe unwrapping patterns
- “Index out of range” explained - Array bounds checking
- Decoding Swift error messages - Reading compiler complaints
- What is a stack trace? - Reading the left panel after a crash
- Simulator vs Device: Why it works here but not there
Debugging Techniques
- Exception breakpoints: Catch crashes before they happen - Setup and usage
- Watchpoints: Break when a value changes - Memory debugging
- LLDB expressions: Modify state while debugging -
expr command
- Debugging async code with breakpoints - Task context, continuation issues
- Zombie objects: Finding messages to deallocated instances
- Retain cycles in closures: Finding and fixing - Weak/unowned patterns
- Autorelease pool debugging - When memory spikes unexpectedly
- Lazy loading gone wrong - Debugging initialization order
- Background thread crashes - Thread safety debugging
- Debugging slow app launch times - Pre-main vs post-main
Networking
- Charles Proxy basics for iOS - SSL pinning, request inspection
- Debugging URLSession with custom delegates - Logging layer
- Timeout issues and how to debug them - Connection vs request timeouts
- Mocking network responses for debugging - Without third-party libs
SwiftUI-Specific
- Debugging view identity issues - Why your view keeps resetting
- Finding unnecessary view redraws - Instruments + Self._printChanges
- Environment object nil crashes - Debugging missing injection
- Navigation stack debugging - Path issues, deep linking problems
Core Data / Persistence
- Core Data debugging flags -
-com.apple.CoreData.SQLDebug 1
- Migration failures: Debugging lightweight migrations - Model versioning
High-Traffic Topics (Common Searches)
Exact Error Messages
- “Cannot convert value of type” - Fixing type mismatches - Very common search
- “Unexpectedly found nil while unwrapping” - The #1 Swift crash
- “No such module” - Framework linking issues - SPM, CocoaPods problems
- “Signing certificate invalid” - Provisioning hell
- “This app has crashed because it attempted to access privacy-sensitive data” - Info.plist keys
- “Unable to install app - device is passcode protected” - Device trust issues
- “The operation couldn’t be completed. (OSStatus error -10814)” - Keychain errors
App Store & TestFlight Debugging
- “App rejected for crashes” - Finding the crash Apple found
- TestFlight builds not appearing - Processing, entitlements
- “Missing compliance” for encryption - Export compliance fix
- App size too large for cellular download - Asset optimization
- In-App Purchase not working in sandbox - Common IAP debugging
iOS Version-Specific
- iOS 17 migration issues - API deprecations, new requirements
- Xcode 15 build errors after update - Common fixes
- Swift 6 concurrency warnings explained - Sendable, actor isolation
Common “How To” Searches
- How to debug on real device without paid account - Free provisioning limits
- How to clear Xcode cache completely - DerivedData, caches, all of it
- How to debug widgets - WidgetKit debugging tricks
- How to see network requests in Xcode - Without Charles/Proxyman
- How to debug push notifications - Local, remote, APNs issues
Frustrating Issues
- “Works in simulator, crashes on device” - Architecture, permissions
- Build succeeds but app is blank/white - Root view issues
- Xcode stuck on “Installing” or “Copying” - Device sync issues
- Previews not loading - SwiftUI preview debugging
- “Command PhaseScriptExecution failed” - Build script errors
Testing & CI/CD
- XCTest failures that pass locally - CI environment differences
- UI tests timing out - Waiting strategies, accessibility identifiers
- Code coverage not showing - Configuration issues
- Xcode Cloud build failures - Common fixes
- Flaky tests: Finding and fixing - Non-deterministic test debugging
Accessibility
- VoiceOver debugging - Accessibility Inspector usage
- Dynamic Type breaking layouts - Testing large text sizes
- Accessibility audit in Xcode - Built-in tool walkthrough
Localization
- “Missing localization” warnings - Export/import issues
- Right-to-left layout bugs - RTL debugging
- Pseudo-localization for testing - Finding truncation issues
Animation & UI
- Debugging janky animations - 60fps issues, Core Animation
- Keyboard avoiding view issues - Common SwiftUI/UIKit fixes
- Safe area debugging - Notch, home indicator problems
- Dark mode colors not updating - Asset catalog issues
Extensions & Multi-Target
- App Extension debugging - Share, Today, Keyboard extensions
- App Groups data not syncing - Container issues
- Watch app debugging - Pairing, connectivity issues
- Debugging Intent/Siri Shortcuts - Voice command testing
Swift Concurrency
- Actor isolation errors explained - MainActor, nonisolated
- Data race debugging - Thread Sanitizer for async code
- Task cancellation not working - Cooperative cancellation patterns
- Deadlocks with async/await - Common patterns that hang
Build & Configuration
- Debug vs Release behavior differences - Optimization gotchas
- Scheme environment variables - Launch arguments debugging