MCPcopy
hub / github.com/callstack/agent-device / requireIosAppSessionForSnapshot

Function requireIosAppSessionForSnapshot

src/daemon/snapshot-runtime.ts:164–176  ·  view source on GitHub ↗
(
  command: 'snapshot' | 'diff',
  session: SessionState | undefined,
  device: SessionState['device'],
)

Source from the content-addressed store, hash-verified

162}
163
164function 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
178function createSnapshotRuntime(params: {
179 req: DaemonRequest;

Callers 1

Calls 2

isIosFamilyFunction · 0.90
errorResponseFunction · 0.90

Tested by

no test coverage detected