Instruments CPU Profiler fails on iPhone 18 Pro (24A446): configureHardwareCounters: Failed set kpc configuration: Operation not permitted

Hi everyone,

I am encountering a reproducible failure when attempting to profile an iOS app on an iPhone 18 Pro using the CPU Profiler instrument in Xcode Instruments.

As soon as I start recording, the trace aborts immediately (Before Run Started) with the following error:

Failed to start the recording: configureHardwareCounters: Failed set kpc configuration: Operation not permitted.
Environment & Side-by-Side Comparison
In the exact same Instruments session on the same Mac, profiling works fine on an iPhone 17 Pro, which rules out general Developer Mode, pairing, or cable/network issues:

  • Failing Device: iPhone 18 Pro (A20 Pro) — Build 24A446 

  • Working Device: iPhone 17 Pro (A19 Pro) — Build 24B5089g 

  • Host Machine: MacBook Pro (Apple Silicon) running Xcode / Xcode Beta 

  • Template / Instrument: CPU Profiler (hardware PMU counters) 

    Steps to Reproduce
  1. Connect the iPhone 18 Pro (24A446) with Developer Mode enabled. 

  2. Open Instruments and choose a template containing CPU Profiler (or CPU Counters). 

  3. Target the iPhone 18 Pro and click Record. 

  4. Recording fails before start with configureHardwareCounters: Failed set kpc configuration: Operation not permitted. 

    Questions
  5. Is kpc hardware counter configuration restricted on the 24A446 kernel build for A20 Pro, or does this require a specific Xcode / iOS build update to expose the A20 Pro KPEP counter tables?

  6. Is there a recommended workaround (or xctrace flag) to capture hardware cycle/instruction metrics on iPhone 18 Pro?