Skip to main content

RegisteredSim

Struct RegisteredSim 

Source
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: String

Human-chosen device name (also usable as an alias).

§kind: DeviceKind

What 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: bool

Whether 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: String

CoreSimulator UDID.

§runtime: String

Runtime identifier.

§device_type: String

Device 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

Source

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.

Trait Implementations§

Source§

impl Clone for RegisteredSim

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RegisteredSim

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RegisteredSim

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RegisteredSim

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.