( command: 'snapshot' | 'diff', session: SessionState | undefined, device: SessionState['device'], )
| 162 | } |
| 163 | |
| 164 | function requireIosAppSessionForSnapshot( |
| 165 | command: 'snapshot' | 'diff', |
| 166 | session: SessionState | undefined, |
| 167 | device: SessionState['device'], |
| 168 | ): DaemonResponse | null { |
| 169 | if (!isIosFamily(device) || session?.appBundleId) { |
| 170 | return null; |
| 171 | } |
| 172 | return errorResponse( |
| 173 | 'SESSION_NOT_FOUND', |
| 174 | `iOS ${command} requires an active app session on the target device. Run open first (for example: open --session ${session?.name ?? 'sim'} --platform ios --device "<name>" <app>).`, |
| 175 | ); |
| 176 | } |
| 177 | |
| 178 | function createSnapshotRuntime(params: { |
| 179 | req: DaemonRequest; |
no test coverage detected