Does: the platform half of every device verb — one driver per platform, serving its virtual and physical devices. Flows: device selection, Android, iOS.
What core may assume of a driver (core/driver.ts Driver):
resolveSpecnever downloads: it throwsRuntimeMissingErrorwithcomponentwhen a download could fix it.- Core calls
reclaimfor a physical device only. A virtual device is destroyed when its lease ends, and both drivers throw on itsreclaim. - A source (ADR 0061) is never leased; a seed is copied into every virtual device.
- Only core's
ComponentInstallerinstalls or removes a component.
What both drivers keep:
- Owned root (ADR 0001).
createcallsensureOwnedRoot(core/device-root.ts): when nothing is there it creates the root with.simlock-owned.json; otherwise the marker must name this instance and platform; anything else refuses. The key isdrivers.<platform>.deviceRoot(absolute). A refusal (OwnedRootError) skips that platform only and emitsdriver.root-rejected. - Scope every command to the root. Ownership is membership in the root, never a name prefix. iOS only: under
drivers.ios.deviceSet: "default"(ADR 0048) simulators stay in Xcode's set with no owned root, and a device is this instance's only when its durable mark names the instance id. - Opaque to core.
address,driverData,deviceRoot,drivers.<platform>.*and the keys a driver's definition file declares underios.*orandroid.*are carried unread. - A driver's
DeviceDataTableis built without a driver instance, so a device loads where its driver is refused;productionDeviceDataTables(daemon/driver-discovery.ts) passes both tables on every host. - A driver imports only core and ports: never the bus, the contract, leasing, the gateway or the daemon. No lint rule holds this.
- Facts reach the bus through callbacks.
daemon/driver-discovery.tsbridges a driver's constructor callbacks to an event or to the logger. - Prerequisites (
iosPrerequisites,androidPrerequisites) are noDrivermethod: they are built even when the driver did not start, and onlydoctorruns them. - Passthrough. The driver owns the scoping flags and the refused verbs (
PassthroughRefusedError). With a device (device.exec) it also fills the lease's device in and refuses a command naming another, throughother-device-refusal.ts(ADR 0047).hasTerminal: falsemeansdevice.exec: refuse what needs a tty.
- A root is an accident boundary, not a security boundary.
simctl --set <root>or a raisedADB_LOCAL_TRANSPORT_MAX_PORTreaches in. Any lease holder can name another Simlock device inadb -s/simctl. Mutually untrusted agents need OS-level isolation. - Ownership is proven at startup and trusted for the daemon's life. A root swapped by
mvor a symlink is not noticed by reports. Onlydoctor --purge-orphansre-proves (revalidateRoot) before destroying. A restart re-proves everything. - Physical devices have no accident boundary. Any host tool sees them; an app another agent
installs is uninstalled on reclaim. Re-enrol (
simlock device add) after a deliberate install.