/apple-platform-build:apvt [screen or question, e.g. 'check the profile screen' or 'is #follow at least 44pt wide']from Apple Platform Build
Find and fix layout mistakes in an iOS app running in the iOS Simulator or in a native macOS app (AppKit or SwiftUI) with apvt (Apple Platform View Tester), which reads the live view tree with frames in points, and measure SwiftUI views that re-evaluate their body too often or too slowly. Use after changing a SwiftUI view, UIKit or AppKit layout, when a user reports text cut off, overlapping, truncated, off-screen or outside the window, under the status bar, or too small to tap, when a SwiftUI screen stutters, hitches or burns CPU, or when asked to verify a screen's or window's layout, assert view positions, replay the steps to a screen, or get an annotated screenshot. Not for physical devices, Mac Catalyst, release builds, or color contrast.
Ships in Apple Platform Build. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
apvt (https://github.com/k-ymmt/apvt) injects a small agent into an app launched on the iOS Simulator or on the Mac and reports what the views really look like: the tree with frames in points, and the layout mistakes in it. It also taps, types, replays the steps to a screen (apvt flow), records the app's requests, logs and crashes, and counts SwiftUI body evaluations (apvt perf). Use it instead of guessing from a screenshot or from the source, because SwiftUI's final frames are only known at runtime and a screenshot cannot tell a truncated text from an intentionally short one.
$ARGUMENTS
If the line above still reads $ARGUMENTS literally, the task is the text the user wrote alongside the skill mention; with nothing given, inspect the screen the app currently shows and fix the errors it reports.
apvt on PATH. If apvt --version fails, tell the user in one sentence and give brew install k-ymmt/tap/apvt; do not install it unasked. It needs macOS 15+, Xcode (with the iOS Simulator platform for simulator apps), and Swift 6.2+.perf needs 0.8.0 (and 0.8.1 for tap to flip a Toggle); flow 0.7.0; run, tap, crash and --settle 0.6.0; net and logs 0.5.0; verify and --source 0.4.0; macOS apps and apvt launch 0.3.0; launch-env and type 0.2.0. If the installed apvt is older than what the task needs, give brew upgrade apvt and say what you can do without it.apple-platform-build skill. To verify behavior (taps, flows, crashes, logs) in the simulator rather than layout alone, use the simulator-verify skill, which drives the app and calls apvt on each screen.--device <name|udid> to every command.Build. In the folder of the .xcodeproj / .xcworkspace, apvt run [-- app arguments] builds (Debug, Xcode's DerivedData, so incremental), prints only the error lines when the build fails, and launches the app with the agent: steps 1 and 2 in one command (--scheme, --platform macos, --no-launch when needed). Otherwise BuildProject (Xcode MCP) or xcodebuild, Debug configuration. The path of the built .app is BUILT_PRODUCTS_DIR/FULL_PRODUCT_NAME from xcodebuild -showBuildSettings; for a simulator app the bundle id (PRODUCT_BUNDLE_IDENTIFIER) also works.
Launch so the agent loads. apvt launch is the simple path for both platforms. It terminates a running instance, starts the app with the agent, and waits until the agent answers; arguments after -- go to the app:
apvt launch path/to/MyApp.app -- -screen profile
apvt setup when the simulator is not set up yet (once per boot), installs a given .app, and launches it. After setup, xcrun simctl launch and the home screen also start apps with the agent.get-task-allow, as in a release build) and its error says which build setting to change; apvt never re-signs the app. With the Hardened Runtime it signs its own agent with the app's team certificate from the keychain (--identity picks another). Sandboxed apps work.RunProject, DeviceInteractionInstallAndRun): Xcode replaces the variables that load the agent, so that app answers nothing unless the launch gets them. In the simulator, apvt launch-env --xcode --device <udid> prints JSON with "$(inherited)": ""; pass it as environmentVariables of DeviceInteractionInstallAndRun (the simulator-verify skill builds on this). For a Mac app, apvt launch-env path/to/MyApp.app prints the variables for the scheme's Run > Environment Variables, because RunProject takes no environment; editing the scheme changes the user's project, so ask first, and prefer apvt launch when Xcode's console is not needed. The sandbox token in it lasts until the Mac restarts.apvt status lists the apps that carry the agent on both platforms and prints the relaunch command for simulator apps running without it.
Reach the screen. Launch arguments (-- -screen profile), a deep link (xcrun simctl openurl booted <url> in the simulator), or apvt tap <selector> (apvt tap '#settings', apvt tap text:Checkout): it taps (macOS: clicks) the middle of the node's visible part, then waits for the screen to settle, with no Accessibility permission and no simulator window; it says when another view took the tap. A Toggle, a switch or a row holding one is tapped on the switch itself and the tap reports the change, switch @30 Switch: off → on, or warns when the value stayed the same; trust that line rather than the label's text. Tapping a text field focuses it; then apvt type "text" (--replace, --submit for Return). In the simulator only the foreground app answers; iOS suspends the others. When the screen takes several steps to reach, write them into a flow file once (see Flows) instead of retyping them after every fix.
Inspect. After apvt launch the agent is already up; after any other launch add --wait 10:
apvt inspect --source . --save before.json
Each line names a rule, a node @N, its frame (x,y widthxheight) in points, and what is wrong, followed by how to fix that kind of issue. With --source <dir>, src file:line lines under an issue name the modifiers or constraints that probably cause it; read those first (they are guesses from the code's text). inspect already says how to fix what it found, so apvt rules is not a step. Exit code 1 means at least one error; 0 means none (--fail-on warning to tighten, --fail-on never for a report only). --save keeps the evidence for verify; add --annotate before.png and read the PNG when the text alone does not make the problem clear. A note about failed requests, logged errors or a main-thread hang points outside the layout: read apvt net / apvt logs first. After a launch or tap whose screen still loads, add --settle.
On macOS, inspect and every other command look at one window: the key window unless --window <number|title> names another. Read the header line before the issues: it names the window inspected, and an other windows: line lists the rest. If the window you are checking is not the one named, rerun with --window <title>, and keep passing it to query, assert and screenshot. The key window may be an inspector panel or a sheet; "no issues" (exit 0) for the wrong window proves nothing. Frames there are points from the window's top-left corner, title bar included.
Understand one node before editing. apvt query @N shows the node, its ancestors with their frames and SwiftUI modifiers, text metrics (the width the text needs versus what it has), and its issues; this is what points at the modifier or constraint to change. apvt tree --root <selector> shows a subtree; apvt rules repeats the fix for each rule (apvt rules --platform macos for the Mac wording). Rule messages already name suspects (for example the .fixedSize child that pushed a container past the screen or window); start from those.
Fix, rebuild, relaunch, verify. apvt run (or the flow), then apvt verify --baseline before.json --source .: fixed, still there and new issues, matched by type, identifier and text, and where the old nodes are now; it exits 1 while errors remain. Node numbers change between snapshots, so re-read them from the new output instead of reusing old @N. Stop and report after three rounds on the same issue rather than thrashing.
Assert what you meant, not only that inspect is quiet. inspect checks only its listed rules; an assertion fixes the intent in a command the user can rerun:
apvt assert '#follow' --visible --inside safe-area --min-width 44
apvt assert 'type:Text,text:Inbox' --not-truncated --no-overlap
apvt assert '#plan-free' --same-width '#plan-pro' --align-top '#plan-pro' --left-of '#plan-pro' --spacing 12
Selectors: @12, #identifier, text:Sub, text="Exact", type:Button, role:control, terms joined by commas. References (--inside, --align-*, --left-of, …) must match exactly one node, or be screen / safe-area (macOS: window).
A YAML file, one apvt command per step as typed without apvt:
app: dev.example.app # or platform: macos; device: <simulator> when several are booted
steps:
- run -- -screen checkout # or: launch -- -screen checkout
- tap '#email' # quote selectors: # starts a YAML comment
- type "${EMAIL:[email protected]}" --submit
- tap '#gift-wrap' # a switch: the step shows off → on
- assert '#total' --visible --inside screen
- inspect
apvt flow checkout.yml prints one ✓ / ✗ line per step. A failed check (inspect error, assert, verify) is ✗ and the flow goes on; a step that cannot run (no match, a crash) stops it with that step's output (run apvt crash next). Exit 0 all passed, 1 a check failed, 3 stopped. Steps run in the file's folder; --from N / --until N run part of it, --var NAME=value fills ${NAME}, --verbose prints every output. Write one when a screen takes more than a launch argument to reach or the user wants a check they can rerun; save it next to the code (flows/) only if the user wants it kept.
apvt perfapvt perf # the next 3 s (--for N), the app left alone
apvt perf -- apvt tap '#refresh' # while a command runs (a tap, a flow), and 0.5 s after
apvt perf start; …; apvt perf stop # around anything
It prints the frames (slow: over 33 ms, the worst one and when), the app's view types by body evaluations (updates, instances, ms per update, total, same: the share whose result did not change), and findings, each with a fix:
slow-body X: one evaluation of X's body takes longer than a frame. Move the work (sorting, grouping, formatting, decoding) out of body into the model, init or a .task, and keep the result in state.over-invalidation X: many instances re-evaluated with the same result: they read state they do not show (a whole ObservableObject). Pass the values they show, or use @Observable, or split the state.slow-frames: late frames, with the slow body that likely caused them.To measure an interaction, run it under perf (apvt perf -- apvt tap '#tax-toggle'), and check the tap's off → on line: a tap that flipped nothing measured nothing. Measure before the fix, fix, apvt run, measure the same way again and compare the numbers; that comparison is the evidence. When the cause is plain in a short file, read the code first and use perf to verify the fix; it earns most where the cause is not visible in the code (many views, a library, a body slow only with real data). The counts come from SwiftUI's private AttributeGraph profiler: same is exact on macOS and approximate in the simulator, so treat over-invalidation as a hint to confirm in the code. --save f.json keeps a measurement (apvt perf report f.json), --all adds SwiftUI's own types.
apvt net lists the app's HTTP requests since launch, apvt net show <id> one of them. apvt net mock|fail|rewrite <url> … changes the answers (long texts, empty lists, errors without a backend) until apvt net remove; make the app send the request again, then inspect. apvt net save run.har / apvt net replay run.har --strict repeat a run without the server.apvt logs --level error shows what the app logged; --level hang shows main-thread hangs of a second or more and the app's function that blocked.apvt crash after the app died: the cause, the app's frame with file:line, and what it printed and requested just before. tap and type say at once when the app crashed.Quote the issue lines from inspect as apvt printed them, say which source change fixed each, and end with the final apvt verify, apvt inspect, apvt assert or apvt flow result. For performance, give the apvt perf numbers before and after (updates and ms of the named views, slow frames) measured the same way. When the user asked for a report only, give the issue lines with the suggested fix for each and say that the fixes are unverified. On macOS, name the window each result is for. When you could not verify, for example because the app could not be relaunched under the agent, say that first instead of reporting the fix as done. Include the annotated screenshot path when you wrote one.
unsafe-area and small-target are off (--rule small-target turns the latter on), and offscreen / wider-than-screen measure against the window. Sheets, popovers and panels are windows of their own.--app <bundle-id> or --platform ios-simulator|macos.--all on tree or --include-system on query/assert brings them back.--json for parsing and --snapshot file.json to re-read a saved snapshot without the app. screenshot and --annotate need the running app; on macOS they capture the inspected window.apvt teardown undoes the simulator setup when the user wants the simulator back to normal. On the Mac, quitting the app removes the agent.The full command, selector, assertion and rule reference is in references/commands.md; apvt guide and apvt <command> --help are authoritative for the installed version.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub k-ymmt/skills --plugin apple-platform-build3 skills in this plugin
/apple-platform-buildBuild, test, run, and diagnose Xcode projects for iOS, macOS, watchOS, tvOS, and visionOS. Use whenever a task involves compiling Swift or Objective-C code in an .xcodeproj or .xcworkspace, running XCTest or Swift Testing suites, rendering SwiftUI previews, reading build errors, or driving a simulator. Prefers the Xcode MCP server bundled with this plugin and falls back to xcodebuild./simulator-verifyVerify that an iOS app really works by driving it in the iOS Simulator - build and launch it through the Xcode MCP server, tap, swipe and type through its flows, check each result in the live UI hierarchy, catch crashes and console errors, and check every screen's layout with apvt. Use after implementing or fixing a feature, when asked to test, QA, smoke-test or "check that it works" on the simulator, to reproduce a reported bug, or to walk through a spec or acceptance criteria. Not for unit tests alone (use apple-platform-build), physical devices, or macOS apps.