stuntcam 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,30 +1,17 @@
1
1
  <!-- SPDX-License-Identifier: Apache-2.0 -->
2
2
  # stuntcam
3
3
 
4
- A camera for the iOS Simulator. Your app's real camera code runs unmodified: no code, dependency or project changes. The
5
- simulator shows a synthetic scene (or your image or video) through Apple's own AVFoundation, so previews, photos, video,
6
- QR and barcode scanning and orientation behave the way they do on a phone.
7
-
8
- Needs an Apple-silicon Mac with Xcode 27 and an iOS Simulator runtime (verified: 26.3 and 27.0; 17.5 smoke-tested).
9
- Simulator only: nothing is linked into your app, and device builds never load it.
4
+ A camera for the iOS Simulator. Your app's camera code runs unmodified, through Apple's own AVFoundation.
10
5
 
11
6
  ```sh
12
- npx stuntcam up # no install; or a global install. A devDependency makes `npm ci` fail on Linux CI (the package is darwin/arm64 only)
13
- npx stuntcam up # self-test, then arm a simulator (boots it with the camera if it's shut down)
14
- # run your app as usual: xcodebuild, expo run:ios, react-native run-ios, flutter run, Xcode ⌘R
15
- npx stuntcam status # what each simulator is doing
16
- npx stuntcam doctor # why there's no camera, if there isn't
17
- npx stuntcam down # stop: new launches get no camera, no reboot
7
+ npx stuntcam up
18
8
  ```
19
9
 
20
- UI tests: `npx stuntcam exec -- xcodebuild test -scheme <UI test scheme> -destination id=<udid>`.
10
+ Then run your app as usual. `npx stuntcam down` turns it off; `npx stuntcam doctor` says why if there's no camera.
11
+
12
+ Your Mac's camera: `npx stuntcam source webcam`.
21
13
 
22
- The package is the `stuntcam` command (a native macOS arm64 binary, no install scripts) plus the prebuilt simulator
23
- libraries and the self-test app (inside `share/stuntcam/payload.tar`, byte for byte as built and signed) and the restore
24
- rules, under `share/stuntcam/`. At each use stuntcam checks every file against `share/stuntcam/manifest.txt`, whose
25
- sha256 is built into the `stuntcam` binary (so the files are exactly the ones packaged with it), and unpacks what
26
- simulators read into `~/Library/Application Support/stuntcam`. It uses its own files even when run inside a stuntcam
27
- source checkout, unless `STUNTCAM_USE_CHECKOUT=1` or `--build` says otherwise. `stuntcam version` names the release and the commit it was built from.
14
+ Needs an Apple silicon Mac and Xcode 27. Simulator only: nothing is linked into your app. Run it with `npx` rather than
15
+ adding it as a dependency: the package is macOS-only, so `npm ci` on Linux would fail.
28
16
 
29
- Licence: Apache-2.0 (`LICENSE`); third-party notices: `THIRD_PARTY_NOTICES.md`. Docs, support policy and troubleshooting:
30
- https://github.com/avinav-b/stuntcam
17
+ Docs: https://github.com/avinav-b/stuntcam · Apache-2.0
package/bin/stuntcam CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stuntcam",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A camera for the iOS Simulator: your app's real AVFoundation camera code runs unmodified",
5
5
  "keywords": [
6
6
  "ios",
@@ -1,17 +1,23 @@
1
- stuntcam 1.0.0 commit 11a19148bf48
2
- engine+loader 169441b21047 stub 09908f5dbe40 hook 220744d0eeed canary 6bc80a68 profile d63604f72d3d verdicts 0 xcode 27A266a
1
+ stuntcam 1.1.0 commit 6bd7b84cff3d
2
+ engine+loader cf75da88e48f stub 09908f5dbe40 hook 220744d0eeed canary 6bc80a68 profile d63604f72d3d verdicts 0 helper release bbd93100d187 sha256 ea644e20ecb0441a7a050a30351fa4fa845f7c1631e2c3f46ceafd6d66fb6733 cdhash bac13fba83dc76e15889bfbcf75e58b5ec97752b xcode 27A266a
3
3
  e708d90cb7fbdba6e9ce87a8665137b9b5e1ab7c65e1f142fdc71230e523dfab LICENSE
4
- 3dd81ba84b6a4dfeb7b4b343d18ace3494bfed40dfcfc0dca9a13ac4871f8340 README.md
4
+ bf6f5aa4a274bd08c12a67b37386af1995962eb70a99a8115847c48d6c178fc5 README.md
5
5
  1024d498d028fb1a0b26f51d7b320c76a388b15521161e1234328f5e23c1584a THIRD_PARTY_NOTICES.md
6
- 9fae19767952d78f71df3f5d9b7c25fc70ff72464c6af678b56b6e535f49afab package.json
6
+ d32be6d58f7958c24bf45fc2b17b78ff3e6cc4dc1e795b8ac2c6705bc4d178ee package.json
7
7
  8ae42ce03f16bfe452936d486eb808d552bf83688ba698b43dd0acc7d5eba9b6 share/stuntcam/media/qr.png
8
- bfdcc67bd059f698f7838572b01383f77a44be001e147a21f7919c5d7bc5756b share/stuntcam/payload.tar
8
+ 9f1958f181ba351235f4c0bf56f8bdafb0b80674941a2e0bcb6c9eaf07bce759 share/stuntcam/payload.tar
9
9
  75b4174d043f7d2fe459605c303f197174f11331a0eb8477dafae100ae2a9777 share/stuntcam/profiles/cfg-m10.plist
10
- 429d01946dd057511224a274bbdb0f67dfbdc02a7df62630a6878a64fb7f7a58 share/stuntcam/restore-rules/27A266a.json
11
- d8d739e19dd1997a28b49956e8f60fe6c3522df1f9f8f3ff7b537aee2f6880de payload/builds/169441b21047/libsimcam.dylib
12
- 199f4613219a05661109c6e2f623b3298899e743a06ae4dcb5493922eb002116 payload/builds/169441b21047/libsimcamloader.dylib
10
+ f0df68646713e8d746a6062b7b1d3d1bc5d57159b91f2379da15a24c83908d7b share/stuntcam/restore-rules/27A266a.json
11
+ 3f2174166d7e2712c5cce0278546faf42d1f297f81c954e8ac25d9ea949c4550 share/stuntcam/restore-rules/27A9275.json
12
+ e208cebc0acb7ca8d05070a7dacc09ebab3c4165d977a8ad622ad721a1077ccb share/stuntcam/restore-rules/27B52.json
13
+ 5976280f58f2f33910daa24c5b66c7aedebc0a4375fca0eb516d1e1ffac6bc97 payload/builds/cf75da88e48f/libsimcam.dylib
14
+ 199f4613219a05661109c6e2f623b3298899e743a06ae4dcb5493922eb002116 payload/builds/cf75da88e48f/libsimcamloader.dylib
13
15
  c0c0d78d742df6edc1f483d3330fc2752b1a221f0d2c645876c7bd9dd7505ff4 payload/canary/m10canary.app/Info.plist
14
16
  9c5f266d8d10206b6766d2d2624138733e866e26516563c2fd7723b7e886fc4d payload/canary/m10canary.app/_CodeSignature/CodeResources
15
17
  dcf9c685ec3809bb82e4a3d6d3bef47354038d42dccf698fddb9b05a8509e08f payload/canary/m10canary.app/m10canary
18
+ e361133c3f279b4fa799475a3095c044d870201c91f4899e3d987b3330e1218f payload/helper/bbd93100d187/Stuntcam Camera.app/Contents/CodeResources
19
+ d637012548c46fd3b6ffa374c2d998b70d2fd8cc0e0764d06b5bfa428ed48dda payload/helper/bbd93100d187/Stuntcam Camera.app/Contents/Info.plist
20
+ ea644e20ecb0441a7a050a30351fa4fa845f7c1631e2c3f46ceafd6d66fb6733 payload/helper/bbd93100d187/Stuntcam Camera.app/Contents/MacOS/stuntcam-camera
21
+ 6686de10a28a2fe11b36cbb86dcbacc827cfc4ea116b4dabf1845e5aee629e9b payload/helper/bbd93100d187/Stuntcam Camera.app/Contents/_CodeSignature/CodeResources
16
22
  d33737dc4d9c57aae5129dc70bbc93cbc138d8b97b4856b01575b5bb6ce55e40 payload/hook/220744d0eeed/libsimcamrunnerhook.dylib
17
23
  b363f2d38bb681cd48540bac4a5c88fa53d2b4b451ab9669f89eebab3c892130 payload/stub/09908f5dbe40/libsimcamstub.dylib
Binary file
@@ -66,5 +66,5 @@
66
66
  }
67
67
  ],
68
68
  "switches": {"SIMCAM_XCODE_LIBS=0": "no restores", "SIMCAM_MTC=0": "skip libMainThreadChecker"},
69
- "unverified": ["Xcode 26.6 / 27.1 / 27.2 (U4 part 2)", "Detox / idb inserts (displaced; design §4.1 rule 4: announced, not restored)"]
69
+ "unverified": ["Xcode 26.6 (U4 part 2); 27.1 and 27.2 have their own files (W4 e64)", "Detox / idb inserts (displaced; design §4.1 rule 4: announced, not restored)"]
70
70
  }
@@ -0,0 +1,70 @@
1
+ {
2
+ "proto": 1,
3
+ "xcode": "27.1",
4
+ "xcode_build": "27A9275",
5
+ "source": "derived from 27A266a; test-runner and test-target rules measured on GitHub's xcode-27 runner (W4 e64, measured internally: Xcode 27.1 27A9275, iOS 27.1 runtime); xcode-run libs present and identical (same install names and sizes as 27.0's; each runtime build has its own sha256); ⌘R not driven",
6
+ "root": "the simulator runtime root ($SIMULATOR_ROOT, else $DYLD_ROOT_PATH); paths below starting with / are relative to it",
7
+ "loader_reads": "rules[].name and rules[].libs (ordered; each {path, if?, unless?}; a condition is VAR=value, PREFIX* (any variable with that prefix) or VAR (set)). Everything else is documentation. A missing rule or file falls back to the loader's built-in copy of this file",
8
+ "never_dlopened": "libclang_rt.* (sanitizer runtimes) and libgmalloc.dylib, in every rule and the chain: they only work inserted at launch (ASan aborts with 'Interceptors are not working' when dlopened; a second TSan runtime gets mapped). Hard-coded in the loader, not read from here",
9
+ "rules": [
10
+ {
11
+ "name": "hosted-tests",
12
+ "when": "XCTestBundleInjectPath set and an XCTest marker present (XCInjectBundleInto, XCTestConfigurationFilePath, XCTestBundlePath or XCTestSessionIdentifier)",
13
+ "load": "exactly the XCTestBundleInjectPath list, de-duplicated; /usr/lib/... entries prefixed with the root; our own libraries and the never_dlopened ones skipped",
14
+ "measured": {
15
+ "xcodebuild": ["/usr/lib/libRPAC.dylib", "<DerivedData>/<App>.app/Frameworks/libXCTestBundleInject.dylib", "/usr/lib/libMainThreadChecker.dylib"],
16
+ "xcodebuild_asan": ["__TESTBUNDLE__/Frameworks/libclang_rt.asan_iossim_dynamic.dylib", "+ the three above (the app links its own runtime)"],
17
+ "xcodebuild_tsan": ["__TESTBUNDLE__/Frameworks/libclang_rt.tsan_iossim_dynamic.dylib", "+ the three above (the app links its own runtime)"],
18
+ "xcode_gui_cmd_u": ["/usr/lib/libRPAC.dylib", "/usr/lib/libLogRedirect.dylib", "<DerivedData>/<App>.app/Frameworks/libXCTestBundleInject.dylib", "/usr/lib/libMainThreadChecker.dylib"]
19
+ },
20
+ "without_rule": "xcodebuild test hangs (test bundle never injected)"
21
+ },
22
+ {
23
+ "name": "ui-test-target",
24
+ "when": "XCODE_SCHEME_NAME set (app launched by XCUIApplication), no hosted-test rule",
25
+ "libs": [
26
+ {"path": "/usr/lib/libLogRedirect.dylib", "if": "IDE_CHOSEN_LOGGING_METHOD=2"},
27
+ {"path": "/usr/lib/libMainThreadChecker.dylib", "unless": "SIMCAM_MTC=0"},
28
+ {"path": "/usr/lib/libRPAC.dylib", "if": "PERFC_*"}
29
+ ],
30
+ "engine": true
31
+ },
32
+ {
33
+ "name": "ui-test-runner",
34
+ "when": "executable path contains -Runner.app/",
35
+ "load": "its own XCTestBundleInjectPath list (hosted-tests rule)",
36
+ "engine": false
37
+ },
38
+ {
39
+ "name": "test-runner",
40
+ "when": "read by the runner hook (libsimcamrunnerhook.dylib, engine/runnerhook/runnerhook.m), not the loader: `stuntcam exec -- xcodebuild test` on a launchd-armed or unarmed destination sets TEST_RUNNER_DYLD_INSERT_LIBRARIES=<hook>, which replaces the runner's own insert list (XCTestBundleInjectPath then reads /usr/lib/libRPAC.dylib:<hook>:<hook>); the hook dlopens these in its constructor",
41
+ "libs": [
42
+ {"path": "@testhost/Frameworks/libXCTestBundleInject.dylib", "if": "XCInjectBundleInto"},
43
+ {"path": "/usr/lib/libMainThreadChecker.dylib", "unless": "SIMCAM_MTC=0"},
44
+ {"path": "/usr/lib/libRPAC.dylib", "if": "PERFC_*"}
45
+ ],
46
+ "paths": "@testhost/<rel>: where dyld resolves XCTest's '<built products>/<App>.app/<rel>' entry: the leaf in DYLD_LIBRARY_PATH first (Xcode's iPhoneSimulator.platform/Developer/usr/lib copy), then the built and the installed host. /usr/... gets the runtime root. Launch-only libraries and already-mapped basenames are skipped",
47
+ "measured": {
48
+ "hosted_unarmed": ["/usr/lib/libRPAC.dylib", "<built products>/M11App.app/Frameworks/libXCTestBundleInject.dylib (mapped from Xcode's platform usr/lib)", "<root>/usr/lib/libMainThreadChecker.dylib"],
49
+ "ui_runner_boot_mode": ["/usr/lib/libRPAC.dylib", "<root>/usr/lib/libMainThreadChecker.dylib"],
50
+ "with_TEST_RUNNER_DYLD_INSERT_LIBRARIES": "/usr/lib/libRPAC.dylib:<hook>:<hook> (RPAC still loads; MTC and libXCTestBundleInject don't, and hosted tests hang without the latter: w4 e26)"
51
+ },
52
+ "engine": false
53
+ },
54
+ {
55
+ "name": "xcode-run",
56
+ "when": "an Xcode marker (MTC_*, PERFC_* or IDE_* variable, or DYLD_LIBRARY_PATH inside DerivedData), no rule above",
57
+ "libs": [
58
+ {"path": "/usr/lib/libLogRedirect.dylib", "if": "IDE_CHOSEN_LOGGING_METHOD=2"},
59
+ {"path": "/usr/lib/libMainThreadChecker.dylib", "unless": "SIMCAM_MTC=0"},
60
+ {"path": "/usr/lib/libRPAC.dylib", "if": "PERFC_*"},
61
+ {"path": "/usr/lib/libViewDebuggerSupport.dylib"}
62
+ ],
63
+ "measured_set": ["libLogRedirect", "libMainThreadChecker", "libRPAC", "libViewDebuggerSupport"],
64
+ "not_inserted_by_xcode_27_0": ["libBacktraceRecording (any queue-debugging setting)", "libgmalloc (the scheme's DYLD_INSERT_LIBRARIES option)", "sanitizer runtimes (the app links them)"],
65
+ "notes": "each of these removes itself from DYLD_INSERT_LIBRARIES on load, so only libViewDebuggerSupport is visible in a plain run's env; MTC has no on/off signal (SIMCAM_MTC=0 skips it). Under ⌘R nothing in the app names the launching Xcode (e26), so which file applies comes from the build recorded at arm time"
66
+ }
67
+ ],
68
+ "switches": {"SIMCAM_XCODE_LIBS=0": "no restores", "SIMCAM_MTC=0": "skip libMainThreadChecker"},
69
+ "unverified": ["the xcode-run rule under Xcode 27.1 ⌘R (not driven headless; its libs and Xcode's helper names checked statically only)", "Detox / idb inserts (displaced; design §4.1 rule 4: announced, not restored)"]
70
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "proto": 1,
3
+ "xcode": "27.2",
4
+ "xcode_build": "27B52",
5
+ "source": "derived from 27A266a; test-runner and test-target rules measured on GitHub's xcode-27 runner (W4 e64, measured internally: Xcode 27.2 27B52, iOS 27.2 runtime); xcode-run libs present and identical (same install names and sizes as 27.0's; each runtime build has its own sha256); ⌘R not driven",
6
+ "root": "the simulator runtime root ($SIMULATOR_ROOT, else $DYLD_ROOT_PATH); paths below starting with / are relative to it",
7
+ "loader_reads": "rules[].name and rules[].libs (ordered; each {path, if?, unless?}; a condition is VAR=value, PREFIX* (any variable with that prefix) or VAR (set)). Everything else is documentation. A missing rule or file falls back to the loader's built-in copy of this file",
8
+ "never_dlopened": "libclang_rt.* (sanitizer runtimes) and libgmalloc.dylib, in every rule and the chain: they only work inserted at launch (ASan aborts with 'Interceptors are not working' when dlopened; a second TSan runtime gets mapped). Hard-coded in the loader, not read from here",
9
+ "rules": [
10
+ {
11
+ "name": "hosted-tests",
12
+ "when": "XCTestBundleInjectPath set and an XCTest marker present (XCInjectBundleInto, XCTestConfigurationFilePath, XCTestBundlePath or XCTestSessionIdentifier)",
13
+ "load": "exactly the XCTestBundleInjectPath list, de-duplicated; /usr/lib/... entries prefixed with the root; our own libraries and the never_dlopened ones skipped",
14
+ "measured": {
15
+ "xcodebuild": ["/usr/lib/libRPAC.dylib", "<DerivedData>/<App>.app/Frameworks/libXCTestBundleInject.dylib", "/usr/lib/libMainThreadChecker.dylib"],
16
+ "xcodebuild_asan": ["__TESTBUNDLE__/Frameworks/libclang_rt.asan_iossim_dynamic.dylib", "+ the three above (the app links its own runtime)"],
17
+ "xcodebuild_tsan": ["__TESTBUNDLE__/Frameworks/libclang_rt.tsan_iossim_dynamic.dylib", "+ the three above (the app links its own runtime)"],
18
+ "xcode_gui_cmd_u": ["/usr/lib/libRPAC.dylib", "/usr/lib/libLogRedirect.dylib", "<DerivedData>/<App>.app/Frameworks/libXCTestBundleInject.dylib", "/usr/lib/libMainThreadChecker.dylib"]
19
+ },
20
+ "without_rule": "xcodebuild test hangs (test bundle never injected)"
21
+ },
22
+ {
23
+ "name": "ui-test-target",
24
+ "when": "XCODE_SCHEME_NAME set (app launched by XCUIApplication), no hosted-test rule",
25
+ "libs": [
26
+ {"path": "/usr/lib/libLogRedirect.dylib", "if": "IDE_CHOSEN_LOGGING_METHOD=2"},
27
+ {"path": "/usr/lib/libMainThreadChecker.dylib", "unless": "SIMCAM_MTC=0"},
28
+ {"path": "/usr/lib/libRPAC.dylib", "if": "PERFC_*"}
29
+ ],
30
+ "engine": true
31
+ },
32
+ {
33
+ "name": "ui-test-runner",
34
+ "when": "executable path contains -Runner.app/",
35
+ "load": "its own XCTestBundleInjectPath list (hosted-tests rule)",
36
+ "engine": false
37
+ },
38
+ {
39
+ "name": "test-runner",
40
+ "when": "read by the runner hook (libsimcamrunnerhook.dylib, engine/runnerhook/runnerhook.m), not the loader: `stuntcam exec -- xcodebuild test` on a launchd-armed or unarmed destination sets TEST_RUNNER_DYLD_INSERT_LIBRARIES=<hook>, which replaces the runner's own insert list (XCTestBundleInjectPath then reads /usr/lib/libRPAC.dylib:<hook>:<hook>); the hook dlopens these in its constructor",
41
+ "libs": [
42
+ {"path": "@testhost/Frameworks/libXCTestBundleInject.dylib", "if": "XCInjectBundleInto"},
43
+ {"path": "/usr/lib/libMainThreadChecker.dylib", "unless": "SIMCAM_MTC=0"},
44
+ {"path": "/usr/lib/libRPAC.dylib", "if": "PERFC_*"}
45
+ ],
46
+ "paths": "@testhost/<rel>: where dyld resolves XCTest's '<built products>/<App>.app/<rel>' entry: the leaf in DYLD_LIBRARY_PATH first (Xcode's iPhoneSimulator.platform/Developer/usr/lib copy), then the built and the installed host. /usr/... gets the runtime root. Launch-only libraries and already-mapped basenames are skipped",
47
+ "measured": {
48
+ "hosted_unarmed": ["/usr/lib/libRPAC.dylib", "<built products>/M11App.app/Frameworks/libXCTestBundleInject.dylib (mapped from Xcode's platform usr/lib)", "<root>/usr/lib/libMainThreadChecker.dylib"],
49
+ "ui_runner_boot_mode": ["/usr/lib/libRPAC.dylib", "<root>/usr/lib/libMainThreadChecker.dylib"],
50
+ "with_TEST_RUNNER_DYLD_INSERT_LIBRARIES": "/usr/lib/libRPAC.dylib:<hook>:<hook> (RPAC still loads; MTC and libXCTestBundleInject don't, and hosted tests hang without the latter: w4 e26)"
51
+ },
52
+ "engine": false
53
+ },
54
+ {
55
+ "name": "xcode-run",
56
+ "when": "an Xcode marker (MTC_*, PERFC_* or IDE_* variable, or DYLD_LIBRARY_PATH inside DerivedData), no rule above",
57
+ "libs": [
58
+ {"path": "/usr/lib/libLogRedirect.dylib", "if": "IDE_CHOSEN_LOGGING_METHOD=2"},
59
+ {"path": "/usr/lib/libMainThreadChecker.dylib", "unless": "SIMCAM_MTC=0"},
60
+ {"path": "/usr/lib/libRPAC.dylib", "if": "PERFC_*"},
61
+ {"path": "/usr/lib/libViewDebuggerSupport.dylib"}
62
+ ],
63
+ "measured_set": ["libLogRedirect", "libMainThreadChecker", "libRPAC", "libViewDebuggerSupport"],
64
+ "not_inserted_by_xcode_27_0": ["libBacktraceRecording (any queue-debugging setting)", "libgmalloc (the scheme's DYLD_INSERT_LIBRARIES option)", "sanitizer runtimes (the app links them)"],
65
+ "notes": "each of these removes itself from DYLD_INSERT_LIBRARIES on load, so only libViewDebuggerSupport is visible in a plain run's env; MTC has no on/off signal (SIMCAM_MTC=0 skips it). Under ⌘R nothing in the app names the launching Xcode (e26), so which file applies comes from the build recorded at arm time"
66
+ }
67
+ ],
68
+ "switches": {"SIMCAM_XCODE_LIBS=0": "no restores", "SIMCAM_MTC=0": "skip libMainThreadChecker"},
69
+ "unverified": ["the xcode-run rule under Xcode 27.2 ⌘R (not driven headless; its libs and Xcode's helper names checked statically only)", "Detox / idb inserts (displaced; design §4.1 rule 4: announced, not restored)"]
70
+ }