Skip to content

[build-tools] Add iOS Simulator recorder#3950

Open
sjchmiela wants to merge 8 commits into
mainfrom
stanley/add-record-sim
Open

[build-tools] Add iOS Simulator recorder#3950
sjchmiela wants to merge 8 commits into
mainfrom
stanley/add-record-sim

Conversation

@sjchmiela

Copy link
Copy Markdown
Contributor

Why

Add a small Swift helper for recording iOS Simulator screen output from EAS build workers. The helper produces either segmented fMP4 output with manifest metadata for playlist construction or one continuous MP4 when segmentation is disabled.

How

  • Added a record-sim Swift package under @expo/build-tools resources.
  • Added yarn workspace @expo/build-tools build:record-sim for local builds into packages/build-tools/bin/record-sim.
  • Updated iOS worker packaging to build record-sim from source and copy only the executable into the worker archive.
  • Ignored the generated local bin/record-sim binary.

Test Plan

  • yarn workspace @expo/build-tools build:record-sim
  • packages/build-tools/bin/record-sim --help
  • bash -n packages/worker/package.sh
  • yarn workspace @expo/build-tools typecheck
  • ./node_modules/.bin/oxfmt --check packages/build-tools/.gitignore packages/build-tools/package.json packages/worker/package.sh packages/build-tools/src/index.ts

@sjchmiela sjchmiela added the no changelog PR that doesn't require a changelog entry label Jul 3, 2026
@sjchmiela sjchmiela requested a review from Copilot July 3, 2026 21:40
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.28%. Comparing base (a848411) to head (b0c0ca7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3950   +/-   ##
=======================================
  Coverage   59.28%   59.28%           
=======================================
  Files         935      935           
  Lines       41093    41093           
  Branches     8660     8660           
=======================================
  Hits        24356    24356           
  Misses      16643    16643           
  Partials       94       94           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Swift-based record-sim helper under @expo/build-tools to record iOS Simulator screen output (either segmented fMP4 + manifest metadata for HLS/CMAF-style workflows, or a single MP4 when segmentation is disabled), and updates worker packaging to build and include the executable in iOS worker archives.

Changes:

  • Introduces a Swift Package (packages/build-tools/resources/record-sim) implementing a simulator framebuffer-based recorder plus a small CLI.
  • Adds a local build script (yarn workspace @expo/build-tools build:record-sim) that builds the Swift executable into packages/build-tools/bin/record-sim.
  • Updates iOS worker packaging to build record-sim from source during packaging and include only the executable in the iOS worker tarball; ignores the locally generated binary in git.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/worker/package.sh Builds record-sim during iOS worker packaging and copies the executable into the worker archive.
packages/build-tools/package.json Adds build:record-sim script to build/copy the Swift executable into bin/.
packages/build-tools/.gitignore Ignores the generated bin/record-sim binary.
packages/build-tools/resources/record-sim/Package.swift Defines the Swift package (library + executable) and required frameworks.
packages/build-tools/resources/record-sim/README.md Documents output format and CLI/library usage.
packages/build-tools/resources/record-sim/.gitignore Ignores local SwiftPM/Xcode build outputs.
packages/build-tools/resources/record-sim/Sources/RecordSim/SimulatorRecorder.swift Implements the recording pipeline using private simulator framebuffer callbacks + AVAssetWriter.
packages/build-tools/resources/record-sim/Sources/RecordSim/RecordingOutputWriter.swift Handles segmented output emission and writes session.json manifest.
packages/build-tools/resources/record-sim/Sources/RecordSim/FramebufferDisplaySource.swift Interfaces with private simulator services to obtain IOSurface snapshots and callbacks.
packages/build-tools/resources/record-sim/Sources/RecordSim/PrivateSimulatorServices.swift Loads private frameworks and locates simulator devices/state.
packages/build-tools/resources/record-sim/Sources/RecordSim/RecordingModels.swift Defines configuration and manifest/segment model types.
packages/build-tools/resources/record-sim/Sources/RecordSim/Utilities.swift Shared helpers (time conversion, JSON encoding, monotonic clock).
packages/build-tools/resources/record-sim/Sources/record-sim/main.swift CLI argument parsing and orchestration of the recorder lifecycle.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/worker/package.sh
Comment thread packages/worker/package.sh Outdated
Comment thread packages/build-tools/package.json Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Comment thread packages/worker/package.sh

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread packages/build-tools/resources/record-sim/Sources/record-sim/main.swift Outdated
@sjchmiela sjchmiela marked this pull request as ready for review July 3, 2026 22:19
@sjchmiela sjchmiela requested a review from szdziedzic July 3, 2026 22:20
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants