MCPcopy Create free account
hub / github.com/callstack/agent-device / isAndroidPackageInstalled

Function isAndroidPackageInstalled

src/platforms/android/app-lifecycle.ts:543–558  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  packageName: string,
)

Source from the content-addressed store, hash-verified

541}
542
543async function isAndroidPackageInstalled(
544 device: DeviceInfo,
545 packageName: string,
546): Promise<boolean> {
547 const result = await runAndroidAdb(device, ['shell', 'pm', 'path', packageName], {
548 allowFailure: true,
549 });
550 const output = `${result.stdout}\n${result.stderr}`;
551 if (result.exitCode === 0 && /\bpackage:/i.test(output)) {
552 return true;
553 }
554 if (looksLikeMissingAndroidPackageOutput(output)) {
555 return false;
556 }
557 return false;
558}
559
560async function maybeRethrowAndroidMissingPackageError(
561 device: DeviceInfo,

Callers 2

openAndroidPackageFunction · 0.85

Calls 2

runAndroidAdbFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…