mirror of
https://github.com/software-mansion/argent.git
synced 2026-09-14 19:27:14 +08:00
6e9e45c9f0
This pull request lets Argent drive a simulator or emulator another process is already running, attaching to its simulator-server rather than spawning a second one. A provider writes a JSON descriptor to `~/.argent/providers/` listing the devices it offers and the mechanisms Argent may use on each. They appear in `list-devices` with an `ext:` id and work with the existing tools. The file is re-read on every call, so a withdrawal or a narrowed grant applies immediately. `ios.additionalDeviceSets` (#600) already makes such a simulator reachable by UDID. What changes is ownership. `boot-device` and `stop-simulator-server` refuse these devices, anything the provider did not grant is refused with a message naming it and Argent uses only the endpoints its own simulator-server build serves. A grant binds to the device rather than to one of its names, so the real udid or serial is gated exactly like the `ext:` id. Android emulators are covered too and a device visible to both a provider and `adb`/`simctl` is listed once. The contract ships as `schemas/device-provider-v1.json`, validated by `argent providers check`, and is documented in `docs/reference/device-providers.mdx`. Includes unit tests and an e2e phase where the harness acts as its own provider. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for discovering and connecting to externally managed devices. * Added `argent providers` commands for listing, validating, publishing, withdrawing, and pruning providers. * Added provider-aware simulator, debugger, profiler, native tools, and device listings. * Added capability controls, endpoint validation, revocation handling, and provider-specific diagnostics. * Added automatic CLI discovery for provider integrations. * **Bug Fixes** * Improved service recovery and paused-runtime error reporting. * Improved simulator keyboard and paste command reliability. * **Documentation** * Documented provider descriptors, capabilities, lifecycle rules, and CLI usage. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
14 lines
655 B
TypeScript
14 lines
655 B
TypeScript
/**
|
|
* Device-provider discovery reads `~/.argent/providers/`, which is
|
|
* machine-global and describes whatever is running on the developer's machine
|
|
* right now: a live provider publishes its real booted devices there. Any test
|
|
* that touches list-devices or resolves a device would then see a device its
|
|
* fixtures never created, so it passes in CI and fails on the machine of
|
|
* whoever is actually using a provider.
|
|
*
|
|
* Opt back in by deleting this variable (it outranks
|
|
* `ARGENT_DEVICE_PROVIDERS`) and pointing `ARGENT_DEVICE_PROVIDERS` at a
|
|
* fixture, as the external-device tests do.
|
|
*/
|
|
process.env.ARGENT_DISABLE_DEVICE_PROVIDERS = "1";
|