Skip to content

feat: add deterministic device permissions API#123

Open
V3RON wants to merge 6 commits into
mainfrom
impl/device-permissions
Open

feat: add deterministic device permissions API#123
V3RON wants to merge 6 commits into
mainfrom
impl/device-permissions

Conversation

@V3RON
Copy link
Copy Markdown
Contributor

@V3RON V3RON commented May 19, 2026

Summary

  • add a host-backed device.permissions runtime API and bridge RPCs for deterministic permission control
  • reset outstanding permission mutations across Harness session restarts/disposal and route permissions: true through the same controller
  • implement Android ADB, iOS simulator simctl privacy, and physical-iOS XCTest prompt-policy adapters with targeted tests and docs

Why this matters

  • gives tests a deterministic way to prepare permission state without ad hoc app-side helpers
  • keeps platform-specific behavior behind one host-side seam, so runtime and Jest lifecycle code stay platform-agnostic
  • preserves existing config compatibility while making permission cleanup explicit and reversible between test files

Platform behavior

  • Android emulator / physical: named and bulk operations mutate declared dangerous permissions via ADB
  • iOS simulator: supported simctl privacy services are deterministic; unsupported services like camera warn and no-op in v1
  • iOS physical: named deterministic mutations warn and no-op; bulk operations configure XCTest Agent prompt handling for future prompts only

Validation

  • pnpm vitest run "packages/jest/src/__tests__/harness-session.test.ts" "packages/jest/src/__tests__/execute-run.test.ts" "packages/jest/src/__tests__/bridge.test.ts" "packages/runtime/src/__tests__/device.test.ts" "packages/platform-android/src/__tests__/instance.test.ts" "packages/platform-ios/src/__tests__/instance.test.ts" "packages/platform-ios/src/__tests__/instance-xctest-agent.test.ts" "packages/platform-ios/src/__tests__/xctest-agent-client.test.ts" "packages/platform-ios/src/__tests__/xctest-agent-capabilities.test.ts" "packages/platform-ios/src/__tests__/xctest-agent.test.ts" "packages/platform-ios/src/__tests__/simctl.test.ts"
  • pnpm tsc -p "packages/platforms/tsconfig.lib.json" --pretty false && pnpm tsc -p "packages/bridge/tsconfig.lib.json" --pretty false && pnpm tsc -p "packages/runtime/tsconfig.lib.json" --pretty false && pnpm tsc -p "packages/jest/tsconfig.lib.json" --pretty false && pnpm tsc -p "packages/platform-android/tsconfig.lib.json" --pretty false && pnpm tsc -p "packages/platform-ios/tsconfig.lib.json" --pretty false
  • NX_DAEMON=false pnpm nx affected -t test --base=origin/main --head=HEAD
  • NX_DAEMON=false pnpm nx affected -t build --base=origin/main --head=HEAD

Notes

  • v1 intentionally does not add iOS simulator camera, applesimutils, deterministic physical-iOS named permission mutation, or physical-iOS per-permission prompt matching
  • the successful pre-push hook regenerated local unstaged files in actions/shared/index.cjs and packages/coverage-ios/tsconfig*.json; they are not part of this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-harness Ready Ready Preview, Comment May 19, 2026 8:09am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant