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.

  1. Turn on the camera in the booted simulator

    npx stuntcam up

    The first run takes about a minute: a one-time self-test.

  2. Run your app

    npx expo run:ios

    Or npx react-native run-ios. Use a development build; Expo Go isn't tested.

Change the picture

Switches live. Running apps pick it up without a relaunch.

  • Your imageAny photo on your Mac
    npx stuntcam source image:/path/photo.png
  • Your videoAny clip on your Mac
    npx stuntcam source video:/path/clip.mov
  • A QR codeOf any text or link
    npx stuntcam source qr:'https://example.com'
  • Your Mac's cameramacOS asks for access once
    npx stuntcam source webcam
  • Built-in test sceneThe default, with codes to scan
    npx 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.

CommandWhat it does
npx stuntcam upTurns on the camera. --udid picks a simulator
npx stuntcam downTurns it off, with no reboot
npx stuntcam statusShows what each simulator is doing
npx stuntcam doctorExplains why there's no camera
npx stuntcam orient landscapeLeftRotates 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 --reboot
No camera after the simulator restarted?

A restart turns the camera off. Turn it on again.

npx stuntcam up
Tests 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)".

npx stuntcam up --mode launchd
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.

AgentInstall the skill
Claude Code/plugin install stuntcam --marketplace avinav-b/stuntcam
Codex, Cursor and othersnpx skills add avinav-b/stuntcam
By handDownload SKILL.md into your agent's skills folder, as stuntcam/SKILL.md
  • No permission alert--grant allows the camera before the app asks
  • A camera it can scriptsource qr: and image: test scanning and photo flows
  • Output it can checkstatus --json and trace show the camera was used
  • Works with your test toolslaunchd mode for tools that inject libraries

Limits

What doesn't match a real iPhone yet.

FeatureStatus
4K at 60 fpsPartlyRecords at about 16–32 fps
ZoomPartlyAccepted, but the picture doesn't zoom
Flutter camera in landscapePartlyThe picture is 90° off
Focus lockNoFocus can't be locked
FlashNoNever fires
720p, Live Photo, depth dataNoReported 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

Next steps

Esc