(
simulator: SimulatorMetadata,
current: SimulatorStateResponse | null,
)
| 2160 | } |
| 2161 | |
| 2162 | function selectedStateFromSimulator( |
| 2163 | simulator: SimulatorMetadata, |
| 2164 | current: SimulatorStateResponse | null, |
| 2165 | ): SimulatorStateResponse { |
| 2166 | const display = simulator.privateDisplay; |
| 2167 | return { |
| 2168 | booted: simulator.isBooted, |
| 2169 | displayReady: display?.displayReady ?? false, |
| 2170 | displayStatus: |
| 2171 | display?.displayStatus ?? |
| 2172 | (simulator.isBooted ? "Waiting for display" : "Boot required"), |
| 2173 | foregroundApp: |
| 2174 | current?.udid === simulator.udid ? current.foregroundApp : null, |
| 2175 | frameSequence: display?.frameSequence ?? 0, |
| 2176 | lastFrameAgeMs: |
| 2177 | current?.udid === simulator.udid ? current.lastFrameAgeMs : null, |
| 2178 | lastFrameAt: display?.lastFrameAt ?? 0, |
| 2179 | simulator, |
| 2180 | udid: simulator.udid, |
| 2181 | }; |
| 2182 | } |
| 2183 | |
| 2184 | async function runSimulatorLifecycleAction( |
| 2185 | kind: SimulatorTransition["kind"], |
no outgoing calls
no test coverage detected