---
title: "Automating App Store screenshots with Claude Code"
slug: automating-app-store-screenshots-with-claude-code
section: tech
date: 2026-10-23T08:46:00.000Z
canonical: https://roland.leth.ro/blog/tech/automating-app-store-screenshots-with-claude-code
description: "Automating App Store screenshots with Claude Code: the app renders every frame from its own SwiftUI components, no UI tests, and exports them at store size."
---

[Reckon][reckon], my decision journal, and [Digest][digest], a food journal I'm working on, both automate their App Store screenshots from inside the app. 

Every screenshot is a SwiftUI view in the debug build, made of the app’s real components over sample data in an in-memory container, and the app draws it into a PNG itself, at the exact size App Store Connect wants; there's no screenshot of the simulator involved. So if I change a component, every screenshot that shows it changes on the next export, in every set.

The screenshots code was fully created with Claude Code (as usual, [under my guidance][plan]), and through the simulator integration it also runs the app and exports the screenshots, so the process is kinda fully automated, I just brainstorm with it. Uploading the sets and testing them against each other is [its own post][ab] (also kinda automated), so this one stops at the PNGs.

If you search for how to automate App Store screenshots, the usual answer is fastlane. Its `snapshot` runs UI tests that tap through the app and call `snapshot("name")` on every screen worth keeping, then `frameit` puts a device frame, a title and a background around each capture.

That works pretty well when your screenshots are screens, but most of mine aren’t, so `snapshot` doesn't really work at all.

![Reckon’s first screenshot: the headline “Make better decisions.” over 3 resolved decision rows, right, wrong and mixed, floating on a green ground with no device][image-1]

## Rendering inside the app

It didn’t actually start in the app. I use Claude Design for [interface work][plan], so my original ask was for Claude Design prompts, and a Figma MCP server was the other option on the table.

Both lost, for different reasons. A design tool can only paste in crops of real screens, while the app can render UI elements themselves, in whatever state a screenshot needs. I think code that can be built and run is a much better place for it. And once the screenshots are code, the next test round, a copy fix or a new device size are just an edit and an export.

Everything related to this lives in one folder that’s `#if DEBUG` from the first line to the last, so none of it ships. A set is an ordered list of screenshot specs plus a palette, and a spec is a headline, an optional subhead and a hero, the visual under the headline.

The sets only differ in their copy, their first screenshot’s hero or their structure, and share the rest; that’s what keeps Reckon’s 9 of them from drifting apart, and why a copy edit is one line. A few tests pin that down, too: unique ids, every emphasized word actually present in its headline, 3 sets per test round, etc.

The one thing a capture can’t do is lift a component out of a screen. In Reckon’s third screenshot, the confidence slider floats over the check-in screen it came from, at full size, and it’s the app’s own slider card, fed sample values instead of a view model:

![Reckon’s third screenshot: the headline “Something changed?” over the check-in screen, with the confidence slider card lifted out and floating over it][image-2]

The screens underneath are composed from the app’s real rows and cards, laid out at the app’s width, with exactly the rows a screenshot needs. In Reckon, even their labels come from the same code the app uses, so a screenshot can’t show anything the app wouldn’t show for the same data.

As for the device around them, it’s drawn in SwiftUI as well: the bezel, the corners, the status bar and the iPhone’s Dynamic Island, at the real screen’s size. That part is no different from putting a screenshot in a clay iPhone mockup in Figma or similar, it’s just done in code.

There’s a catch, though. A change to a screen’s arrangement, like a new section or a moved control, won’t reach the screenshots by itself; I have to update the composition too. A change _inside_ a component does reach them, on the next export, everywhere that component shows up.

The screenshots get their own data, too. I keep a private in-memory `SwiftData` container with one story followed across the set, and every number a headline quotes lives in there and _nowhere_ else.

Then I pin everything that could move. The screenshots’ “today” is 13 September 2026, and the settings come from their own suite, not the simulator’s. The app formats dates with the device’s region, so a US simulator might print “May 16” where the screenshots say “16 May”; the exporter just refuses a month-first region.

I keep these fixtures apart from the demo data in both apps, so staging something for a manual test can’t move a headline’s number.

iPad isn’t a second set of views either: the same specs render on a second canvas, where the composed screens draw the app’s split view, laid out to measurements from real captures. I first planned iPad screenshots only for whichever set won the A/B test, until it turned out every set in the test needs both.

![The same check-in screenshot on iPad: the lifted slider over the app’s split view, with the decisions list on the left][image-3]

Digest’s renderer came a few days later and by then, the method was written down where Claude Code reads it (it’s a [skill][skills] now), so Digest’s is mostly a port: the generic files nearly verbatim, with the look from Digest’s own brief.

![Digest’s first screenshot, “Log a meal in 10 seconds”, with the log sheet floated over the Today screen, on a dark green ground][image-4]

So now, for a new project, I just write its brief, have Claude build the in-code logic and reuse the skill.

## The export

The app hosts each screenshot in its own full-screen window, above anything else on screen, and draws that window into a PNG with `drawHierarchy(in:afterScreenUpdates:)`, UIKit’s way of drawing a view exactly as it looks at that moment.

Why not `ImageRenderer`, SwiftUI’s view-to-image API? It leaves UIKit-backed views blank, and SwiftUI’s `Slider`, `List` and text fields are UIKit underneath, which are pretty much the controls the screenshots exist to show. So each screenshot really has to be on screen, and it flashes on the simulator for a moment while it’s drawn.

That also means the simulator decides the size. The window is drawn at the screen’s scale, so the canvas has to _be_ the simulator’s screen: an iPhone 17 Pro Max gives 1320×2868 and an iPad Pro 13-inch 2064×2752, which is what App Store Connect wants for the largest iPhone and iPad.

The first version used the older 1290×2796, and I saw white strips on the right and bottom of the simulator, then black ones, and Claude explained them twice before checking any sizes. The PNGs were clean, it turned out, and the strips were just the simulator’s screen past a smaller window. Now the exporter refuses any simulator whose screen isn’t a canvas, and the error names the 2 that work.

It also refuses to write a wrong screenshot, one that renders fine but not the way it was designed, with something missing or out of place. Those are easy to miss in a folder of over 100 PNGs, so the export checks what it can and, when a check fails, stops for that screenshot instead of writing it. A warning in the log, in the middle of a run, is one nobody reads.

A few smaller traps, which might save you some time if you build your own:

- A hero sized to its content pushed the headline off the top on a tall device, so heroes now fill a fixed area and clip whatever doesn’t fit.
- Views that tell rows apart by `persistentModelID` need the fixtures actually inserted into the container; otherwise every row shares one temporary id and they all collapse into one.
- Renaming a screenshot left its old PNG behind, so the export removes stale ones now.

## Letting Claude Code run it

In Reckon, the export is a button in Settings: Showcase Frames, “Export all frames”. Claude Code builds the debug app, launches it on the iPhone 17 Pro Max simulator, taps its way to the button and waits for the progress line to finish, then does the same on the iPad, and before anything gets committed, it reads a few of the PNGs back.

That’s 106 screenshots in 2 runs.

The tapping is probably the most fragile part. The simulator integration’s screenshots can fail for a whole session, and then the model taps by coordinates it saw earlier, more or less blind (that, and the rest of what goes wrong around the simulator, is [its own post][simulator]).

But the export doesn’t really _need_ any of that, only a foreground scene, so in Digest I improved this a bit and skip the button and start from a launch argument:

```bash
xcrun simctl launch --terminate-running-process <device> <bundleId> -exportMarketingFrames
```

On the app side, a modifier on the root view waits for the scene to become active, and runs the export once:

```swift
.task(id: scenePhase) {
   guard scenePhase == .active, !hasStarted, ProcessInfo.processInfo.arguments.contains(Self.argument) else {
      return
   }

   hasStarted = true

   // [...]

   await viewModel.export(variants)

   // [...]
}
```

`hasStarted` is there because the scene can go inactive and active again mid-run, and the result goes to the log, since nobody’s looking at a screen.

If I add `-marketingVariant 00-default`, it just exports a single set. Launch arguments in the `-key value` form land in `UserDefaults`, so the app reads it with one `string(forKey:)`; an unknown id throws, instead of exporting nothing or everything, either of which would look like a result.

Where do the files go?

Straight into the repository. The exporter works out the output folder from its own source file path at compile time (`#filePath`), and since an app running in the simulator can write to the Mac’s disk, the PNGs actually end up in the checkout the app was built from.

I commit them, too. The script that uploads them to App Store Connect (more on it in [the A/B testing post][ab]) reads them from there, and a copy change shows up in review as an image diff. Not a perfectly clean one, though.

A rerun rewrites unchanged screenshots with sub-pixel differences in charts and shadows, so exporting everything to change one set touches _every_ other set’s PNGs as well; that’s why `-marketingVariant` exists.

What’s left for me, then?

Well, the brainstorming, and most of it happens _before_ any screenshot code: the brief, the fixtures and the hooks, the things no layout tweak can fix later.

Picking the hooks, running the test and the upload script behind it are in [the A/B testing post][ab].

Previews (videos) are rendered as well, though outside the app, and that’s [the next post][next].

If you’ve found a way to automate yours some other way, let me know [@roland.leth.ro][] or [@rolandleth][]!

The rest of the series is listed in [Claude Code for iOS development][series], and the post before this one is [Testing code when you don’t know the right answer][prev].

[reckon]: /projects/reckon "Reckon"
[digest]: /projects/digest "Digest"
[plan]: /blog/tech/the-model-will-hand-you-a-confident-plan-for-anything "The model will hand you a confident plan for anything"
[skills]: /blog/tech/claude-code-rules-hooks-and-skills-and-how-i-set-mine-up "Claude Code rules, hooks and skills, and how I set mine up"
[simulator]: /blog/tech/claude-code-and-the-ios-simulator-what-breaks "Claude Code and the iOS Simulator: what breaks"
[ab]: /blog/tech/ab-testing-app-store-screenshots-on-a-small-app "A/B testing App Store screenshots on a small app"
[prev]: /blog/tech/testing-code-when-you-dont-know-the-right-answer "Testing code when you don’t know the right answer"
[next]: /blog/tech/app-store-preview-videos-with-claude-code "App Store preview videos with Claude Code"
[series]: /blog/tech/claude-code-for-ios-development "Claude Code for iOS development"
[@roland.leth.ro]: https://bsky.app/profile/roland.leth.ro "@roland.leth.ro on Bluesky"
[@rolandleth]: https://x.com/rolandleth "@rolandleth on X"
[image-1]: https://1b8s9qdvrd8l8jfm.public.blob.vercel-storage.com/posts/tech/automating-app-store-screenshots-with-claude-code/media/automating-app-store-screenshots-with-claude-code/8a490617db53dcb0-reckon-iphone-1-hook.png "Reckon, screenshot 1: no device, just 3 rows from the app"
[image-2]: https://1b8s9qdvrd8l8jfm.public.blob.vercel-storage.com/posts/tech/automating-app-store-screenshots-with-claude-code/media/automating-app-store-screenshots-with-claude-code/1aa608cdb8a6ae7d-reckon-iphone-3-check-in.png "Reckon, screenshot 3: the app’s own slider card, lifted out of the check-in screen"
[image-3]: https://1b8s9qdvrd8l8jfm.public.blob.vercel-storage.com/posts/tech/automating-app-store-screenshots-with-claude-code/media/automating-app-store-screenshots-with-claude-code/5501d25ccf82fd60-reckon-ipad-3-check-in.png "The same spec on the iPad canvas"
[image-4]: https://1b8s9qdvrd8l8jfm.public.blob.vercel-storage.com/posts/tech/automating-app-store-screenshots-with-claude-code/media/automating-app-store-screenshots-with-claude-code/01d254043866bebf-digest-iphone-1-log.png "Digest, screenshot 1 of its default set, from the ported renderer"