# Building and verification

## Requirements

- macOS 14 or newer
- Xcode 16 or newer
- `yt-dlp`, `ffmpeg`, and `deno` for complete runtime and media-test coverage
- Optional: XcodeGen when regenerating the project from `project.yml`

```sh
brew install yt-dlp ffmpeg deno
```

## Run tests

```sh
cd code
xcodebuild -project StreamRecorder.xcodeproj \
  -scheme StreamRecorder \
  -destination 'platform=macOS' \
  test CODE_SIGNING_ALLOWED=NO
```

FFmpeg/ffprobe integration tests skip when their executables are not installed at a supported path.

## Build

```sh
xcodebuild -project StreamRecorder.xcodeproj \
  -scheme StreamRecorder \
  -configuration Release \
  -destination 'platform=macOS' \
  -derivedDataPath DerivedData \
  build CODE_SIGNING_ALLOWED=NO
```

The unsigned local result is under `DerivedData/Build/Products/Release/StreamRecorder.app`. `DerivedData/` is ignored and must not be included in redistributed source.

## Regenerate the Xcode project

If project settings are changed in `project.yml`:

```sh
brew install xcodegen
xcodegen generate
```

Review the generated project diff and rerun tests. Keep bundle identifiers, deployment target, target memberships, and the shared scheme consistent.

## Smoke test

Run the prototype from Xcode, confirm dependency detection, choose a temporary output folder, and use a stream you are authorized to record. Exercise current-point start, from-beginning catch-up, manual stop, successful MP4 playback, Finder reveal, and app quit during recording.
