1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Reading and writing `defaults` inside a simulator: which spelling of the
//! program starts, and what its answers mean.
use crateDeviceControlError;
/// How `defaults` is named inside a simulator, in the order tried.
///
/// Neither spelling works on every runtime. Earlier runtimes refused the
/// bare name — `simctl spawn` runs no login shell, and it exited 255 with
/// nothing on stderr — so every call site was written with the absolute
/// path. Under Xcode 27 `simctl spawn` reads a path that starts with `/`
/// from the host's root, not the runtime's — the runtime still has
/// `usr/bin/defaults` — so the absolute path fails to start (111, "Invalid
/// or missing Program"; measured 2026-09-25), while the bare name runs.
/// Tried in order; only a spelling that did not start moves on to the next.
pub const DEFAULTS_PROGRAMS: & = &;
/// Whether a `simctl spawn` failure means the program never started, as
/// opposed to the program running and answering with a failure. Only the
/// first is fixed by spelling the program another way.
pub
/// Whether `defaults` itself said the key (or its domain) is not there —
/// its own words, not any non-zero exit. A spawn that never started also
/// exits non-zero, and reading that as "unset" turned a broken read into a
/// confident "no".
///
/// Two generations of wording: up to iOS 26 `The domain/default pair of
/// (D, K) does not exist`; from iOS 27 (and macOS 27) `Could not find key
/// 'K' in domain 'D'.` or `Domain 'D' not found.`, for read and delete
/// alike.
/// `defaults read` of a boolean: `1` or `0` on a line of its own.
/// Anything else is not an answer.