XcodeAgent SkillsAIInstrumentsiOS

Xcode 27.2 brings new skills: xctrace for Instruments and app-resizability for iPhone Duo

The Xcode 27.2 release notes don’t mention it, but the command that exports Apple’s skills returns a different list. Xcode 27.0 had 10. Xcode 27.2 has 11:

xcrun agent skills export ~/temporary/path
ChangeSkillWhat it’s for
NewxctraceRecording and reading Instruments traces from the terminal
Newapp-resizabilityPreparing an app for windows that change size, including iPhone Duo
No longer thereuikit-app-modernizationModernizing UIKit apps for multiple windows

If you’re new to this topic, start with what agent skills are. This post covers what changed.

xctrace: Instruments from the terminal

xctrace is the command-line interface to Instruments, and it has been around for years. What’s new is the skill: it teaches an agent how to use it, so it can record a trace and read it without you opening the graphical interface.

It’s small: an entry file and two references. One explains how a trace is organized and how to read it, and the other how to investigate UI hangs. It activates when you ask about performance, such as why an app is slow, uses too much CPU or memory, or stops responding.

The flow it teaches

Record:

xcrun xctrace record --template 'Time Profiler' --instrument Hangs \
  --device "My iPhone" --attach MyApp --time-limit 30s --no-prompt --output app.trace

Read, from general to specific:

# What the trace contains
xcrun xctrace toc app.trace

# The call tree, with the heaviest path marked
xcrun xctrace show app.trace --track "Time Profiler" --calltree "Profile" --format markdown

# A hang summary, with what the main thread was doing
xcrun xctrace triage app.trace --style hangs --format markdown

The skill tells the agent to check xctrace help first, because commands can change between versions. It’s worth doing the same with these examples, which I tried on Xcode 27.2. A show output can run to hundreds of kilobytes, so it’s better to filter it or save it to a file than to read it in the terminal.

To compare a change, --append-run adds a new run to the same trace and --run-name names it: one before and one after.

The most useful part for understanding a hang

Five severity tiers. triage --style hangs classifies each hang by duration:

TierDuration
Potential Interaction DelayOver 33 ms
Brief UnresponsivenessOver 100 ms
MicrohangOver 250 ms
HangOver 500 ms
Severe HangOver 2 s

Busy or blocked. Before reading the call tree, the skill asks you to tell two cases apart:

  • Busy thread: it uses a lot of CPU while the UI doesn’t respond. Look at the time profile.
  • Blocked thread: it uses little CPU because it’s waiting on something. Look at the system calls.

A hang can be a mix of both, but working out which one dominates keeps you from looking in the wrong place.

What it doesn’t cover

triage needs the trace to include the Hangs and Time Profiler instruments, and it doesn’t detect animation or scroll hitches. That’s what the Animation Hitches template in Instruments is for.

There’s also a physical limit: an idle app leaves almost no samples, so you have to use it while recording. And the timings that count come from a real device; the simulator is good for finding problems, not for measuring them.

I haven’t used it to solve a real problem in an app yet. When I do, I’ll cover it with data in another post.

app-resizability: preparing an app for iPhone Duo

This is the one Apple has in mind when it recommends asking Xcode’s assistant to “get my app ready for iPhone Duo.” The phrase doesn’t need to be technical: asking for the app to work on the foldable phone is enough to activate it.

It focuses on UIKit apps, in Swift and Objective-C, and looks for code that assumes the screen size doesn’t change:

It looks forWhy it’s a problem
UIScreen.mainA window no longer equals the screen
interfaceOrientationA window’s shape doesn’t depend on orientation
userInterfaceIdiomAn open iPhone Duo can use a regular-width layout
Symmetric safe areasBars can change while the app runs
UIApplicationDelegate lifecycleIt needs to move to the scene lifecycle

Before touching code it runs three checks, because according to the skill an app that fails any of them can’t resize, no matter what the rest looks like:

  1. Launch screen. If you don’t declare one, iOS 27 rejects the App Store upload with error ITMS-90870 (TN3208).
  2. iPad orientations. It checks that all four are declared.
  3. UIRequiresFullScreen. iOS 27 ignores this key and resizes the scene anyway (TN3192).

These checks only read and report. The skill is explicit about not deleting or adding those keys on its own, because doing so can make an app resizable before its layouts are ready.

It’s also written not to stop halfway: if a file contains the API it’s looking for, it has to replace it or explain why not, ask before making a risky change, and leave everything outside those lines alone.

It’s big: over 1,600 lines counting its references. It’s worth reading before you use it, like any skill. If your app is 100% SwiftUI, much of it won’t apply; for SwiftUI, Apple’s iPhone Duo guide recommends measuring with GeometryReader or onGeometryChange.

What happened to uikit-app-modernization?

It’s no longer in the Xcode 27.2 export, and Apple doesn’t explain why in the release notes. Everything suggests app-resizability replaces it: it has the same purpose and the same four references (screen, orientation, lifecycle, and safe areas), plus a new one on userInterfaceIdiom. That’s my deduction, not something Apple has confirmed.

If you had it installed, it stays in your skills folder until you delete it: exporting doesn’t clean up anything you already copied. It’s best to replace it.

When to install each one

SkillHow to install it
xctraceGlobally, if you measure performance now and then. It’s small and works in any project
app-resizabilityPer project, in UIKit apps you’re preparing for iPhone Duo

Copy only the folder you need:

xcrun agent skills export /tmp/apple-skills
cp -R /tmp/apple-skills/xctrace ~/.claude/skills/
cp -R /tmp/apple-skills/app-resizability ~/path/to/your-app/.claude/skills/

If you use Codex or Cursor, swap ~/.claude/skills/ for ~/.agents/skills/.

A note if you use swiftui-expert-skill, which I covered in the essential set: it also analyzes traces, so both can activate on a .trace file. A reasonable split is to use xctrace to record and diagnose in general, and the other to interpret what’s specific to SwiftUI.

Check your skills every time you update Xcode

This backs up what I recommended in that series: Apple’s skills change with each Xcode release, sometimes without notice. After updating, export to a temporary folder and compare with what you have:

xcrun agent skills export /tmp/apple-skills
diff -rq /tmp/apple-skills/modernize-tests ~/.claude/skills/modernize-tests

When I did this with my three Apple skills installed from Xcode 27.0, modernize-tests and device-interaction were unchanged, and swiftui-whats-new-27 only fixed a typo in a code example.

Sources