How to profile CPU usage using Instruments in Xcode

To profile CPU usage in XCode, run the app then open the Debug Navigator and click on "Profile in Instruments."

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 10/31/2023 at 13:20
Last Updated on 10/31/2023 at 13:48
<p>Two flowers that represent Instruments and Xcode side by side. Beneath them sits the text "Profile CPU."</p>

To profile CPU usage in XCode, run the app then open the Debug Navigator and click on "Profile in Instruments."

SubscribeDownload Open Source Starter Project

Step One: Run the App

<p>A screenshot of XCode highlighting the run button on the top center left.</p>

In order to profile the CPU of an app, it must be run from XCode.

Step Two: Profile in Instruments

<p>A screenshot of Xcode showing how if you select the debug navigator and click CPU, a button called "Profile in Instruments" becomes available.</p>

Open the Debug Navigator, select CPU and click Profile in Instruments.

Step Three: Click Profile

<p>A screenshot of Xcode showing the pop up that appears when you attempt to profile cpu in instruments. Click Profile.</p>

In the pop up that appears, click Profile.

Step Four: Select CPU Usage

<p>A screenshot of Instruments highlighting the CPU usage bar and the stack trace that appears beneath it.</p>

In the Instruments App, select the moment within the CPU Usage bar that you wish to analyze. The results will appear in the stack trace beneath it.

Looking to learn more about things you can do with Swift and XCode ?

Search our blog to find educational content on learning how to use Swift and XCode.

Search our Blog

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
SubscribeContact UsVisit our BlogView our ServicesView our Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe