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

Function resolveSelectedDevice

src/cli/commands/connection-runtime.ts:747–777  ·  view source on GitHub ↗
(
  client: AgentDeviceClient,
  flags: CliFlags,
)

Source from the content-addressed store, hash-verified

745}
746
747async function resolveSelectedDevice(
748 client: AgentDeviceClient,
749 flags: CliFlags,
750): Promise<DeviceInfo> {
751 const devices = await client.devices.list({
752 platform: flags.platform,
753 target: flags.target,
754 device: flags.device,
755 udid: flags.udid,
756 serial: flags.serial,
757 iosSimulatorDeviceSet: flags.iosSimulatorDeviceSet,
758 androidDeviceAllowlist: flags.androidDeviceAllowlist,
759 });
760 return await resolveDevice(
761 devices.map((device) => ({
762 ...deviceFieldsFromPublicPlatform(device.platform),
763 id: device.id,
764 name: device.name,
765 kind: device.kind,
766 target: device.target,
767 booted: device.booted,
768 })),
769 {
770 platform: flags.platform,
771 target: flags.target,
772 deviceName: flags.device,
773 udid: flags.udid,
774 serial: flags.serial,
775 },
776 );
777}
778
779function buildProxyDeviceKey(device: DeviceInfo): string {
780 return `${publicPlatformString(device)}:${device.target ?? 'mobile'}:${device.id}`;

Callers 1

resolveProxyLeaseStateFunction · 0.85

Calls 2

resolveDeviceFunction · 0.90

Tested by

no test coverage detected