stuntcam › Getting started
Getting started
stuntcam gives the iOS Simulator a working camera. Turn it on with one command, then run your app as usual. No code changes.
- Needs
- Apple silicon MacXcode 27iOS 17.5–27.2 simulatorNode.js
- Works with
- AVFoundationVisionCamera 5expo-cameraFlutter cameramobile_scanner
Quick start
Pick how you build your app.
Turn on the camera in the booted simulator
npx stuntcam up
The first run takes about a minute: a one-time self-test.
Run your app
npx expo run:ios
Or
npx react-native run-ios. Use a development build; Expo Go isn't tested.
Boot the simulator with the camera on
# simulator shut down npx stuntcam up --udid <simulator> # simulator already booted npx stuntcam up --reboot
xcrun simctl list deviceslists simulator ids. The first run takes about a minute.Run (⌘R) in Xcode, as usual
Turn on the camera in the booted simulator
npx stuntcam up
The first run takes about a minute: a one-time self-test.
Run your app
flutter run
Turn on the camera and allow it for your app
npx stuntcam up --udid $SIM --grant com.example.app
--grantallows camera and microphone, so no prompt appears.Run your tests
npx stuntcam exec -- xcodebuild test -scheme MyApp \ -destination "platform=iOS Simulator,id=$SIM"Use
id=destinations, notname=.
Change the picture
Switches live. Running apps pick it up without a relaunch.
- Your imageAny photo on your Macnpx stuntcam source image:/path/photo.png
- Your videoAny clip on your Macnpx stuntcam source video:/path/clip.mov
- A QR codeOf any text or linknpx stuntcam source qr:'https://example.com'
- Your Mac's cameramacOS asks for access oncenpx stuntcam source webcam
- Built-in test sceneThe default, with codes to scannpx stuntcam source scene
What your app gets
Apple's own AVFoundation objects, so it behaves as on an iPhone.
- Live previewBack wide, ultra-wide, telephoto and front
- PhotosJPEG and HEIC, with EXIF
- Video with audio1080p and 4K, with a generated audio tone
- QR and EAN-13 scanningThrough AVFoundation and Vision
Commands
The ones you'll use. Add -h to any command for its options.
| Command | What it does |
|---|---|
| npx stuntcam up | Turns on the camera. --udid picks a simulator |
| npx stuntcam down | Turns it off, with no reboot |
| npx stuntcam status | Shows what each simulator is doing |
| npx stuntcam doctor | Explains why there's no camera |
| npx stuntcam orient landscapeLeft | Rotates the device, or portrait, auto |
Every command and flag: CLI reference.
Troubleshooting
Start with npx stuntcam doctor. It names the problem.
No camera after Xcode Run (⌘R)?
Xcode needs the simulator booted with the camera on.
npx stuntcam up --rebootNo camera after the simulator restarted?
A restart turns the camera off. Turn it on again.
npx stuntcam upTests ran, but no app used the camera?
Give the simulator by id in the destination, not by name.
-destination 'platform=iOS Simulator,id=<UDID>'Using Detox, or a tool that injects libraries?
Use launchd mode, then give the tool eval "$(stuntcam env)".
The camera stopped for one app?
stuntcam crashed twice in it and turned itself off there. Turn it back on:
npx stuntcam sentinel clear --bundle <bundle id>Using VisionCamera 4?
Version 4 leaves its camera code out of simulator builds. Upgrade to VisionCamera 5.
Every known problem: troubleshooting guide.
For AI agents
Coding agents can run stuntcam on their own. The stuntcam skill tells them how.
| Agent | Install the skill |
|---|---|
| Claude Code | /plugin install stuntcam --marketplace avinav-b/stuntcam |
| Codex, Cursor and others | npx skills add avinav-b/stuntcam |
| By hand | Download SKILL.md into your agent's skills folder, as stuntcam/SKILL.md |
- No permission alert
--grantallows the camera before the app asks - A camera it can script
source qr:andimage:test scanning and photo flows - Output it can check
status --jsonandtraceshow the camera was used - Works with your test toolslaunchd mode for tools that inject libraries
Limits
What doesn't match a real iPhone yet.
| Feature | Status |
|---|---|
| 4K at 60 fps | PartlyRecords at about 16–32 fps |
| Zoom | PartlyAccepted, but the picture doesn't zoom |
| Flutter camera in landscape | PartlyThe picture is 90° off |
| Focus lock | NoFocus can't be locked |
| Flash | NoNever fires |
| 720p, Live Photo, depth data | NoReported as unavailable |
What it changes
Nothing in your app or project.
- Simulator onlyNothing is linked into your app; device builds never load it
- One folder~/Library/Application Support/stuntcam
- No sudo, no networkNever asks for admin rights; sends nothing anywhere
- Verifiable buildBuilt from the public repo by CI, with npm provenance