how can i use xcode instruments to detect hangs and hitches in my app
Asked on 06/27/2025
1 search
To detect hangs and hitches in your app using Xcode Instruments, you can utilize several tools and techniques discussed in the WWDC sessions:
-
SwiftUI Instrument: If your app uses SwiftUI, the SwiftUI instrument can help you identify long updates that may cause hitches or hangs. It provides a high-level view of long updates, highlighting them in orange and red based on their likelihood to contribute to performance issues. You can start by investigating updates marked in red. For more details, you can refer to the session Optimize SwiftUI performance with Instruments.
-
Hangs Instrument: For issues impacting the UI or your app's main thread, the specialized Hangs instrument can be used. It helps analyze blocking behaviors between threads and identify which threads will ultimately unblock them. This is particularly useful for confirming that your app's CPU usage needs optimization. More details can be found in the session Optimize CPU performance with Instruments.
-
XCT Hitch Metric: In Xcode 26, the XCT Hitch metric has been introduced to catch hitches during testing. It reports multiple metrics for your app's hitch performance, such as the Hitch time ratio, which represents the total amount of time your app was hitching over the duration of the measured portion of your test. This can be particularly useful for testing the responsiveness of your UI. More information is available in the session What’s new in Xcode.
By using these tools, you can effectively detect and analyze hangs and hitches in your app, allowing you to optimize its performance.

Optimize SwiftUI performance with Instruments
Discover the new SwiftUI instrument. We’ll cover how SwiftUI updates views, how changes in your app’s data affect those updates, and how the new instrument helps you visualize those causes and effects. To get the most out of this session, we recommend being familiar with writing apps in SwiftUI.

Optimize CPU performance with Instruments
Learn how to optimize your app for Apple silicon with two new hardware-assisted tools in Instruments. We’ll start by covering how to profile your app, then dive deeper by showing every single function called with Processor Trace. We’ll also discuss how to use CPU Counters’ modes to analyze your code for CPU bottlenecks.

What’s new in Xcode 16
Discover the latest productivity and performance improvements in Xcode 16. Learn about enhancements to code completion, diagnostics, and Xcode Previews. Find out more about updates in builds and explore improvements in debugging and Instruments.