SwiftUI Instrumentation Fails to start

I am trying to perform swiftUI instrumentation on my ios app. whenever i hit the rocord button, the app launches on target device and closes with the error:

Failed to start the recording: Failed starting ktrace session.

How do i resolve this please?

Answered by szymczyk in 864687022

Some questions.

  1. By "SwiftUI instrumentation", do you mean profile your app in Instruments with the SwiftUI instrument?
  2. What version of Xcode are you running?
  3. What version of iOS is the device running?

The new SwiftUI instrument Apple added in Xcode 26 requires iOS 26+. If your device is running an earlier version of iOS, you can't use the new SwiftUI instrument.

If you can't use the new SwiftUI instrument in Xcode 26, click the Add Instrument button above the timeline pane graphs and add the legacy View Body and View Properties instruments to profile the app. Also, remove the SwiftUI instrument from the trace.

Accepted Answer

Some questions.

  1. By "SwiftUI instrumentation", do you mean profile your app in Instruments with the SwiftUI instrument?
  2. What version of Xcode are you running?
  3. What version of iOS is the device running?

The new SwiftUI instrument Apple added in Xcode 26 requires iOS 26+. If your device is running an earlier version of iOS, you can't use the new SwiftUI instrument.

If you can't use the new SwiftUI instrument in Xcode 26, click the Add Instrument button above the timeline pane graphs and add the legacy View Body and View Properties instruments to profile the app. Also, remove the SwiftUI instrument from the trace.

  1. Yes
  2. Xcode 26.0
  3. iOS 18.7.1

Alright, thanks for the feedback. I guess it wasn't working because of the ios version. I tried the legacy version and it work.

Hi there!

Thanks for the feedback. This must be something else going wrong – we should disallow the recording on iOS devices lower than 26.0, so you should not even be allowed to hit the "Record" button.

Would it be possible to file a feedback with Apple (feedback assistant.apple.com), include screenshot of what you're seeing and sysdiagnose from a target device?

Also, please let us know if after recording on the device the new Instrument wouldn't work for some reason.

Thanks!

SwiftUI Instrumentation Fails to start
 
 
Q