CamRelay uses an image or video fixture as the camera feed for apps running in an iOS Simulator or Android Emulator.
The app under test does not need CamRelay code, imports, SDK integration, or special build settings. It continues to use the platform's standard camera APIs.
For a prebuilt CLI, see Installation, including checksum verification and a pinned-release example for another QA repository.
Build with Swift 6.2 or newer on macOS or Linux. iOS Simulator support requires macOS; Linux supports Android relays with FFmpeg. See Android requirements for dependencies and SDK setup.
Build the CLI from the repository root:
swift buildFor iOS, also build the Simulator runtime, boot exactly one Simulator, and start a relay:
./scripts/build-runtime.sh
.build/debug/camrelay path/to/fixture.mp4Launch or relaunch the app after the relay is ready. Stop the relay with Ctrl-C.
For Android, list the available Android Virtual Devices and choose one of the printed names:
CAMRELAY_DEFAULT_SDK="$HOME/Library/Android/sdk"
if [ "$(uname -s)" = Linux ]; then
CAMRELAY_DEFAULT_SDK="$HOME/Android/Sdk"
fi
CAMRELAY_SDK="${ANDROID_SDK_ROOT:-${ANDROID_HOME:-$CAMRELAY_DEFAULT_SDK}}"
"$CAMRELAY_SDK/emulator/emulator" -list-avds
AVD_NAME=your_avd_name
.build/debug/camrelay emulator start --platform android --avd "$AVD_NAME"
.build/debug/camrelay --platform android --avd "$AVD_NAME" path/to/fixture.mp4
# After stopping the relay:
.build/debug/camrelay emulator stop --platform android --avd "$AVD_NAME"Stopping an Android relay leaves the emulator and app running. Use emulator stop when you are finished with the AVD.
- Image and video fixtures with deterministic looping.
- Front and back cameras exposed through standard platform camera APIs.
- Live switching between named fixtures without restarting the app.
- Replay and session control from terminal keys or separate CLI processes.
- Simulator-wide delivery to multiple iOS app processes.
- Preview and photo capture on both platforms, with additional AVFoundation capture features on iOS.
- Commands to start and stop a compatible Android Emulator.
- Installation: install release packages on macOS or Linux and use a pinned version in QA.
- Usage: build and run CamRelay, switch fixtures, and use it from CI.
- CLI reference: commands, options, status output, and exit codes.
- iOS Simulator: activation, camera compatibility, and platform limitations.
- Android Emulator: AVD setup, start and stop behavior, compatibility, and limitations.
- Architecture: how CamRelay delivers fixtures to apps on each platform.
- Development: repository layout, build details, and tests.