Cannot run Animation Hitches Instrument

I'm trying to run the Instrument "Animation Hitches", but it fails immediately after starting on the iPhone. This happens on multiple projects, including a brand new project.

I get the following errors:

Timestamp            | Message
(Before Run Started) | Unexpected failure: Couriers have returned unexpectedly.
(Before Run Started) | Failed to start the recording: Failed starting
ktrace session.

The issue also happens with the instruments App Launch, but not with any other that I tested.

Is this a bug?

Using Xcode Version 16.1, Mac Mini M1 Sequoia 15.1. Running project on iPhone 14 Pro iOS 18.1.

Answered by cecilelebleu in 814918022

Answer by Rob on StackOverflow:

The problem would appear to be using “Recording mode” of “Deferred” when profiling on a physical iOS device, regardless of which Instruments template you choose. If you change the recording mode to “Capture last n seconds” (or, where available, “Immediate”), this problem does not manifest itself.

This problem jumps out at you when using “Animation hitches” template because that template does not accept a recording mode of “Immediate” and defaults to “Deferred” mode. But if you pick a different template, and manually change its recording mode to “Deferred”, that will also manifest the same problem.

Selecting "Capture last n seconds" instead of "Deferred" solves the issue.

I've submitted a bug report: "Deferred" mode should not be selected in the Animation Hitches template if it's not supported.

I see the same problem whenever I profile on a physical iOS device from Xcode 16.1 or 16.2 Beta 2 with any instrument using a recording mode of “deferred” (which happens to be the default recording mode for the Hitches tool). If I change the recording mode to “Capture last n seconds” (or, when available, “Immediate”), the errors do not appear.

FWIW, my configuration is similar: M1 Mac Studio, Sequoia 15.1. Profiling a new blank project on iPhone 16 Pro Max, iOS 18.1.

Accepted Answer

Answer by Rob on StackOverflow:

The problem would appear to be using “Recording mode” of “Deferred” when profiling on a physical iOS device, regardless of which Instruments template you choose. If you change the recording mode to “Capture last n seconds” (or, where available, “Immediate”), this problem does not manifest itself.

This problem jumps out at you when using “Animation hitches” template because that template does not accept a recording mode of “Immediate” and defaults to “Deferred” mode. But if you pick a different template, and manually change its recording mode to “Deferred”, that will also manifest the same problem.

Selecting "Capture last n seconds" instead of "Deferred" solves the issue.

I've submitted a bug report: "Deferred" mode should not be selected in the Animation Hitches template if it's not supported.

Cannot run Animation Hitches Instrument
 
 
Q