MCPcopy Index your code
hub / github.com/callstack/agent-device / deviceForLease

Method deviceForLease

src/cloud-webdriver/runtime.ts:347–359  ·  view source on GitHub ↗
(lease: DeviceLease, prepared: CloudWebDriverPreparedSession)

Source from the content-addressed store, hash-verified

345 }
346
347 private deviceForLease(lease: DeviceLease, prepared: CloudWebDriverPreparedSession): DeviceInfo {
348 return {
349 ...deviceFieldsFromPublicPlatform(prepared.platform),
350 id:
351 prepared.deviceId ??
352 this.options.deviceId?.(lease) ??
353 `${this.provider}:${prepared.platform}:${lease.leaseId}`,
354 name: prepared.deviceName,
355 kind: 'device',
356 target: 'mobile',
357 booted: true,
358 };
359 }
360
361 private findSessionForDevice(device: DeviceInfo): WebDriverProviderSession | undefined {
362 return [...this.sessionsByLeaseId.values()].find((session) => session.device.id === device.id);

Callers 1

allocateMethod · 0.95

Calls 1

Tested by

no test coverage detected