pub struct RegisteredSim {
pub device_name: String,
pub kind: DeviceKind,
pub destructive_opt_in: bool,
pub udid: String,
pub runtime: String,
pub device_type: String,
pub avd_name: Option<String>,
pub locale: Option<String>,
pub runner_port: Option<u16>,
}Expand description
One registered simulator.
Fields§
§device_name: StringHuman-chosen device name (also usable as an alias).
kind: DeviceKindWhat kind of device this is. Absent in registries written before
physical devices were addressable — see DeviceKind for why
that reads as Simulator.
destructive_opt_in: boolWhether destructive actions have been allowed on this device.
Only consulted for physical devices; a simulator is never gated. Recorded once here rather than confirmed per command, because a confirmation that must be typed every time ends up in a script, which is the same as not having one.
udid: StringCoreSimulator UDID.
runtime: StringRuntime identifier.
device_type: StringDevice type identifier.
Apple’s SimDeviceType for a simulator. For an emulator this is
where the AVD name used to live, and rows written before
Self::avd_name existed still keep it there — read it through
that method rather than from here, which is named after the
other half of its rows.
avd_name: Option<String>Which AVD an emulator row names.
The serial is a slot: emulator-5554 belongs to whoever booted
first, so a row holding only a serial names a stranger the moment
somebody else takes that port. The AVD name survives a reboot and
a slot change, and it is the name smix sim boot already starts
the device by.
locale: Option<String>Desired BCP 47 locale tag (e.g. "en-US", "ja-JP"). When set,
smix sim boot enforces it via
defaults write -g AppleLanguages + AppleLocale and reboots the
sim if the current locale differs. None (field absent) =
honor whatever locale the sim boots with, no enforcement.
runner_port: Option<u16>Desired runner port (SmixRunner FlyingFox HTTP port). When set,
smix runner up <alias> binds the runner to this port instead
of the CLI default 22087. Two sims can then run their own runner
in parallel without port collision
(e.g. sim-a.runnerPort = 22087 + sim-b.runnerPort = 22088).
Falls through to --runner-port flag or SMIX_RUNNER_PORT env
when absent.
Implementations§
Source§impl RegisteredSim
impl RegisteredSim
Sourcepub fn avd_name(&self) -> Option<&str>
pub fn avd_name(&self) -> Option<&str>
The AVD this row names, when it names one.
Reads the field, then the place the value lived before that field
existed. One reader, so the two spellings cannot drift apart —
and only for emulators: deviceType on a simulator row carries
Apple’s device type, and reading that as an identity would invent
an AVD named com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro.