You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS driver treats DeviceHub clipboard sync as off when its preference write did not persist #1822
DeviceHubPreferences.disablePasteboardSync (src/drivers/ios/devicehub.ts:76) counts the write as done when defaults import exits 0 (devicehub.ts:67-69). It never reads the value back. On a host where the daemon cannot reach DeviceHub's sandbox container, the import exits 0 and changes nothing. Simlock then boots and grants the simulator with DeviceHub clipboard sync still on, and logs nothing.
Seen on the second Mac (Xcode 27.2) in the slow-lane run from #1580 (lane log /var/folders/rx/c2x4bbm14t30jjs_k9trl_h80000gn/T//simlock-slow-e2e-20261124-152835.log), started over ssh. Read-only checks there, over ssh:
$ defaults export com.apple.dt.Devices -
<dict/>
$ ls ~/Library/Containers/com.apple.dt.Devices/Data/Library/Preferences/
ls: ...: Operation not permitted
On this Mac, from a GUI terminal, the same export shows DevicePreferences and lastSelectedDeviceIdentifier.
The daemon log of that run shows the write was lost. Seed throwaway F5CA288D-… got disablePasteboardSync (seeds.ts:392), and the seed make went on, so the call returned. When the throwaway was deleted, removePasteboardPreference logged could not remove DeviceHub preference for F5CA288D-…: preference deletion failed. The same happened for the leased simulator E2C24057-… at nuke, and for three devices in the warm test. The entry was never there to delete.
The e2e test shows it only as a side effect: DeviceHub selected simulator times out (e2e/slow-ios-window.test.ts:148), because the empty domain has no lastSelectedDeviceIdentifier.
Open question for triage: should disablePasteboardSync read the value back and fail the boot (DriverCrashError) when it is missing? doctor could also check access to the domain.
Confirmed. bug/1822-repro, src/drivers/ios/clipboard.test.ts: "refuses to boot a simulator, for preparation and recovery alike, when DeviceHub's preferences do not keep the pasteboard sync off". The fake domain's containerBlocked mode exports {} and has the import exit 0 without writing anything. The fake answers PlistBuddy Print the way the real tool does (checked here: false with exit 0, and exit 1 for a missing key).
pnpm exec vitest run --project unit src/drivers/ios/clipboard.test.ts
× refuses to boot a simulator, for preparation and recovery alike, ...
AssertionError: promise resolved "{ …(4) }" instead of rejecting
Root cause
Defect. The docs say "A lease is refused if Simlock cannot turn the sync off" (concepts/ios-device-sets.mdx:40). But #editDeviceHubPreferences (src/drivers/ios/devicehub.ts:67-69) counts the edit as done once defaults import exits 0, and never reads the domain back. When the container cannot be reached, the export is empty, the Add calls succeed on it, and the import writes nothing. So makeReady (index.ts:390) and the seed throwaway (seeds.ts:392) boot with sync on.
Simplest fix
Add an optional read-back to #editDeviceHubPreferences. For disablePasteboardSync, after the import it exports again, runs PlistBuddy -c "Print :DevicePreferences:<udid>:pasteboardSyncEnabled", and counts the edit done only when stdout is false. The existing DriverCrashError is unchanged. The helpers that list the exact calls need the two extra calls: clipboard.test.ts, test-slim.tsdeviceHubEdit and its callers, and boot-deadline.test.ts.
Tried: reproduction passes
pnpm exec vitest run --project unit src/drivers/ios/
Test Files 34 passed (34) Tests 769 passed | 1 skipped (770)
Alternatives rejected
Warn and boot anyway: this grants a lease the docs say is refused.
Read the container plist directly: reading it is the access that fails, and cfprefsd owns the file.
A doctor check only: the daemon would still grant leases. It can be added later.
Risk
On a daemon started over ssh (the second Mac), every iOS lease under default is now refused. The maintainer must accept this.
Only the fake proves the fix. The one sign that a re-export would show the lost write there is the later failed delete.
Each boot runs two more bounded commands.
Fast track
Defect: yes
Fix tried: yes
Nothing public added or broken: no — iOS leases on an ssh-started daemon go from granted to refused
No ADR or rule changed: yes
One fix: no — warn-and-boot would change what a user sees
Maintainer decision on the triage report (2026-11-24):
Approved as proposed: read pasteboardSyncEnabled back after the import and refuse the boot with the existing DriverCrashError unless it reads false. Accepted: on a daemon that cannot reach DeviceHub's preferences (for example one started over ssh), iOS leases under deviceSet: "default" are now refused, as the docs already say.
Activity
V3RON commentedon Nov 24, 2026
Reproduction
Confirmed.
bug/1822-repro,src/drivers/ios/clipboard.test.ts: "refuses to boot a simulator, for preparation and recovery alike, when DeviceHub's preferences do not keep the pasteboard sync off". The fake domain'scontainerBlockedmode exports{}and has the import exit 0 without writing anything. The fake answersPlistBuddy Printthe way the real tool does (checked here:falsewith exit 0, and exit 1 for a missing key).Root cause
Defect. The docs say "A lease is refused if Simlock cannot turn the sync off" (
concepts/ios-device-sets.mdx:40). But#editDeviceHubPreferences(src/drivers/ios/devicehub.ts:67-69) counts the edit as done oncedefaults importexits 0, and never reads the domain back. When the container cannot be reached, the export is empty, theAddcalls succeed on it, and the import writes nothing. SomakeReady(index.ts:390) and the seed throwaway (seeds.ts:392) boot with sync on.Simplest fix
Add an optional read-back to
#editDeviceHubPreferences. FordisablePasteboardSync, after the import it exports again, runsPlistBuddy -c "Print :DevicePreferences:<udid>:pasteboardSyncEnabled", and counts the edit done only when stdout isfalse. The existingDriverCrashErroris unchanged. The helpers that list the exact calls need the two extra calls:clipboard.test.ts,test-slim.tsdeviceHubEditand its callers, andboot-deadline.test.ts.Alternatives rejected
doctorcheck only: the daemon would still grant leases. It can be added later.Risk
defaultis now refused. The maintainer must accept this.Fast track
Written by an agent.
V3RON commentedon Nov 24, 2026
Maintainer decision on the triage report (2026-11-24):
Approved as proposed: read
pasteboardSyncEnabledback after the import and refuse the boot with the existingDriverCrashErrorunless it readsfalse. Accepted: on a daemon that cannot reach DeviceHub's preferences (for example one started over ssh), iOS leases underdeviceSet: "default"are now refused, as the docs already say.Written by an agent.
V3RON commentedon Nov 24, 2026
Delivery run
Merged: #1829 (#1822)
Parked: none
Waiting: none
Written by an agent.
fix(ios): refuse a boot whose DeviceHub pasteboard-sync write did not…