How to Script and Capture App Demo Flows in the Xcode Simulator (Ready for Reely & App Store Previews)
Mobile app launch videos start with one thing: clean, repeatable footage.

Mobile app launch videos start with one thing: clean, repeatable footage.
If you can script your app flow once and capture it reliably in the Xcode simulator, you can turn every feature into a demo reel on demand — for Reely, Screen Studio, RocketSim, SmoothCapture, or any app preview video generator.
This tutorial walks through a practical, engineering-first workflow to script, record, and export simulator footage that’s ready for App Store, Product Hunt, and Reely.
Why script your app demo flows instead of hand-recording?
Before we get into commands and resolutions, it’s worth asking: why bother scripting?
Because a scripted simulator flow gives you:
- Repeatability — every build produces the same demo path, so your launch video can be regenerated in minutes.
- Speed — no more re-recording takes every time you tweak a button label.
- Agent-friendly workflows — XCUIAutomation flows can be driven by your AI coding agent plus tools like Reely’s MCP integration.
Apple’s own XCUIAutomation docs emphasize this: you can record interactions once and replay them, using XCUIApplication launch arguments and XCUIElement actions to make “feature change → deterministic demo flow” a standard part of your pipeline.
Step 0: Prerequisites & basic setup
Make sure your environment is ready before you touch the simulator.
You’ll need:
- Xcode 15 or 16 installed on macOS
- At least one iOS Simulator runtime downloaded
- A build of your app that runs cleanly in the simulator
- Optional but recommended: a UI test target (for XCUIAutomation)
Check your simulator runtimes:
- In Xcode: Settings → Platforms → iOS → Download runtime(s).
- Or via CLI:
- Export runtimes:
xcodebuild -exportPlatform(Xcode 16+) - Import runtimes:
xcrun simctl runtime add <path-to-runtime>
- Export runtimes:
This makes your simulator environment portable across multiple Macs or CI machines, so a demo flow can run the same way everywhere.
For a deeper primer on simulators and just‑sim tooling, see the related in‑depth guide: Mobile app simulators for launch videos: from Xcode simulator to just‑sim tools.
Step 1: Define your demo script as a flow, not a feature list
The fastest way to generate usable footage is to script a story, not just “tap every button.”
Apple’s app preview guidance is clear:
- Tell one cohesive story per preview.
- Make sure each preview shows something new.
- Keep it short and focused — 15–30 seconds is typical.
1.1 Answer 4 questions before you script
Write down:
- Who is this for?
- App Store visitors, Product Hunt launch, X/YouTube Shorts?
- One core outcome
- "User goes from empty state to first success" or "AI assistant solves a task in three taps."
- Three beats
- Example for a to‑do app:
- Beat 1: Create first list
- Beat 2: Add tasks with natural language
- Beat 3: Complete a task and visualize progress
- Example for a to‑do app:
- Call to action or closing moment
- A satisfying animation, success screen, or simple logo bumper.
1.2 Translate beats into a tap/gesture sequence
Take those beats and write them as explicit UI steps:
- Launch app to a clean state
- Tap "New List"
- Type "Product Hunt launch"
- Tap "Add task"
- Type "Record demo reels in Reely"
- Mark task complete and linger on the success animation
This sequence becomes the backbone of your XCUIAutomation test and the flow your AI agent can later replay.
Step 2: Script the flow with XCUIAutomation (UI tests)
Now turn your written steps into a repeatable UI test.
2.1 Create a UI test target
In Xcode:
- Select your project.
- Add a UI Testing Bundle if you don’t have one.
- Make sure it runs against your main app target.
2.2 Use launch arguments & environment
Configure the app to boot into a demo‑ready state:
final class DemoFlowTests: XCTestCase {
func testLaunchDemoFlow() {
let app = XCUIApplication()
app.launchArguments += ["-demoFlow", "true"]
app.launchEnvironment["DEMO_USER_ID"] = "preview-user"
app.launch()
runDemoSequence(in: app)
}
}
Inside your app, you can branch on these flags to:
- Seed fixtures
- Skip onboarding
- Disable rate prompts or paywalls
2.3 Implement the interaction sequence
Use XCUIElement and XCUIDevice to mirror your script:
func runDemoSequence(in app: XCUIApplication) {
let newListButton = app.buttons["New List"]
XCTAssertTrue(newListButton.waitForExistence(timeout: 5))
newListButton.tap()
let titleField = app.textFields["List Title"]
titleField.tap()
titleField.typeText("Product Hunt launch")
let addTaskButton = app.buttons["Add Task"]
addTaskButton.tap()
let taskField = app.textFields["Task Name"]
taskField.tap()
taskField.typeText("Record demo reels in Reely")
let completeToggle = app.switches["Task Complete"]
completeToggle.tap()
// Allow animation to play for recording
sleep(3)
}
Key points:
- Use
waitForExistencefor robustness. - Add short
sleepcalls where you want animations to play out for the recording. - Keep the test focused on the demo flow, not assertions.
2.4 Make the test agent‑friendly
If you’re using AI coding agents (Cursor, Claude Code, etc.) and Reely’s MCP agent:
- Keep test names and comments explicit (
// Demo: core onboarding flow). - Expose a single entry point like
testLaunchDemoFlow()that agents can trigger to drive capture.
This is how you get from “agent built the app” → “agent ran the demo flow” → “tool auto‑generated app demo reels after build.”
Step 3: Record video in the Xcode simulator via CLI
With your flow scripted, you’re ready to capture.
Apple documents a simple command for video capture:
xcrun simctl io booted recordVideo demo.mp4
3.1 Basic recording workflow
Use this loop:
- Boot the simulator and run your UI test:
xcodebuild \ -scheme YourAppUITests \ -destination 'platform=iOS Simulator,name=iPhone 16 Pro' \ test - Start recording before the test runs (or in a separate terminal window):
xcrun simctl io booted recordVideo --codec=h264 demo.mp4 - Stop recording once the test completes:
- Press
Ctrl + Cin the recording terminal.
- Press
You now have a device‑specific H.264 video captured directly from the simulator.
3.2 Choosing codecs and quality
For App Store app previews:
- Apple accepts H.264 and ProRes 422 (HQ).
- Simulator recordings are typically 30 fps by default.
Flags to consider:
--codec=h264for standard previews and Reely inputs.- Some tools (e.g., RocketSim) can go up to 120 fps HEVC for extra‑smooth footage, but keep export guidelines in mind.
3.3 Keep recordings deterministic
To avoid subtle differences between takes:
- Always run the same test method for capture (e.g.,
testLaunchDemoFlow). - Use the same device, OS version, and runtime.
- Control random seeds in the app for animations or AI results.
This makes it trivial for CI tools to automatically generate app demo reels from build artifacts after a successful build.
Step 4: Frame size, resolutions, and aspect ratios
The simulator recording will match the simulated device’s resolution.
For App Store and launch videos, you need to be aware of:
- Preview duration: up to 30 seconds per preview
- Asset size: typically max 500 MB per video
- Device‑specific dimensions: videos are separate from screenshot dimensions
Common master screenshot sizes (handy for static frames and backgrounds):
- iPhone 6.9" class: 1320×2868, 1290×2796, or 1260×2736
- iPad 13" class: 2064×2752 or 2048×2732
App Store Connect can scale smaller device classes from the largest approved size.
For Reely inputs:
- Just feed the raw simulator recording; Reely will handle device framing, multiple aspect ratios, and 4K master exports.
- Reely’s motion system supports kinetic typography and device choreography, so you don’t need to add overlays in the simulator; you just need clean base footage.
Here’s how typical preview constraints line up.

Key App Store preview constraints at a glance: up to three 30-second, 500 MB videos per language, device-specific captures, H.264 or ProRes 422 (HQ) formats, and 30 fps max playback.
When you record, aim for:
- 30 fps for App Store compliance.
- One master resolution per device family (e.g., a single iPhone 6.9" simulator).
Step 5: Export, trim, and hand off to Reely or other generators
Once you have demo.mp4, you’re ready to turn it into a launch asset.
5.1 Quick trimming (if needed)
If your test includes setup/teardown you don’t want on camera, do a light trim:
- Use QuickTime or
ffmpegto cut the in/out points.
Example ffmpeg command:
ffmpeg -i demo.mp4 -ss 00:00:02 -to 00:00:22 -c copy demo_trimmed.mp4
This creates a 20‑second segment (good for feature teasers).
5.2 Feeding footage into Reely
Reely is built to turn simulator footage and screenshots into:
- 10–20s feature teasers
- 30–60s full launch promos
You can:
- Open Reely’s native macOS app and import
demo_trimmed.mp4. - Let Reely’s motion studio auto‑remove dead air, time music/sound cues, and apply kinetic typography.
- Use brand-theme-from-app to match titles and backgrounds to your UI.
Since Reely renders locally and talks directly to Xcode’s iOS Simulator, you can also:
- Let your AI coding agent call Reely’s MCP tool.
- Have the agent run
testLaunchDemoFlow, capture the simulator, and then call Reely to build a demo reel — all in one workflow.
That’s the “promo from code in minutes” loop: the app is built, tests run, and a launch video pops out without you opening a timeline editor.
5.3 Using footage in other tools
If you prefer a different stack:
- Screen Studio iOS app demo: import the simulator recording and layer additional motion or annotations (noting its mobile capture limitations for taps and zooms).
- RocketSim: use its high‑FPS simulator recording and tools optimized for AI agents, then hand off clips downstream.
- SmoothCapture: record and frame App Store preview videos fast, using your scripted flow instead of manual taps.
Reely sits alongside these as the app store app preview video generator that’s explicitly optimized for launch reels and agentic workflows.
Step 6: Automate the whole thing in CI
The real power comes when your CI server can auto‑generate app demo reels after a build.
6.1 High‑level CI pipeline
After each successful build on main:
- Install simulator runtimes (if needed) using
xcrun simctl runtime add. - Run UI tests for demo flows.
- Record video with
xcrun simctl io booted recordVideo. - Upload artifacts to your storage or feed them into Reely via MCP.
6.2 Example CI steps (pseudo YAML)
steps:
- name: Run demo UI tests
run: |
xcodebuild \
-scheme YourAppUITests \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
test
- name: Record simulator demo
run: |
xcrun simctl io booted recordVideo --codec=h264 demo_ci.mp4 &
RECORD_PID=$!
# Wait for tests (or use job dependency)
wait
kill $RECORD_PID
- name: Hand off to Reely agent
run: |
reely-agent build-reel \
--input demo_ci.mp4 \
--output artifacts/feature-teaser.mp4
With this in place, every successful build can generate:
- A fresh feature teaser for X, LinkedIn, or YouTube Shorts.
- An updated launch promo when you ship a major version.
- App Store preview candidates ready for manual review.
Step 7: Validate against real devices (and avoid simulator traps)
Apple warns that the simulator can be smoother than real devices.
To avoid misleading previews:
- Occasionally record the same scripted flow on a physical device.
- Compare timing and performance to your simulator footage.
Best practice:
- Use simulator+automation to generate fast demos.
- Use a device pass to confirm the flow is realistic before submitting to App Store or running paid ads.
FAQ: scripting and capturing Xcode simulator demo flows
How long should an iOS app preview video be?
Apple allows up to 30 seconds per app preview, with up to three previews per language.
Most teams aim for 15–30 seconds at 30 fps, keeping each preview focused on a single story or feature.
Can I use Xcode simulator recordings for App Store previews?
Apple’s guidelines say app previews should be captured on device and be device‑specific.
In practice, many teams use simulator recordings for drafts, testing, and launch‑video generators like Reely, then validate the final flows on real hardware before submission.
What’s the best way to automate taps and gestures in the simulator?
Use XCUIAutomation via a UI test target:
XCUIApplicationto launch the app with demo flags.XCUIElementfor taps, swipes, and typing.XCUIDevicefor hardware button simulation.
This produces repeatable, agent‑friendly demo flows.
How do I automatically generate app demo reels after a build?
Set up your CI pipeline to:
- Run a dedicated demo UI test (e.g.,
testLaunchDemoFlow). - Capture the simulator with
xcrun simctl io booted recordVideo. - Pass the resulting video to a generator like Reely, via its agent/MCP tool or macOS app.
That gives you a CI tool that creates an app demo video after each successful build, with minimal manual effort.
Why use Reely instead of a generic AI video tool for app demos?
Reely is the app launch video generator for mobile developers:
- Built around simulator footage, device frames, and kinetic typography.
- Integrates with AI coding agents to go from "build feature" → "build demo reel".
- Renders locally on macOS, uses the iOS Simulator, and keeps every scene editable.
Generic AI tools rarely understand real app flows or plug into your code + CI + simulator stack as deeply.
Wrap‑up: from code to launch reel in minutes
If you:
- Script your demo flow with XCUIAutomation
- Capture it in the Xcode simulator with
xcrun simctl io booted recordVideo - Export clean, device‑specific clips
- Feed them into Reely or your preferred app preview video generator
…you have a repeatable pipeline where every feature change can become a video asset on demand.
Your agent built the app. Let it build the demo reel too.