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

Function installAndroidAdbPackage

src/platforms/android/adb-executor.ts:351–369  ·  view source on GitHub ↗
(
  apkPath: string,
  options?: AndroidAdbInstallOptions & AndroidAdbTransferProviderOptions,
)

Source from the content-addressed store, hash-verified

349}
350
351export async function installAndroidAdbPackage(
352 apkPath: string,
353 options?: AndroidAdbInstallOptions & AndroidAdbTransferProviderOptions,
354): Promise<AndroidAdbExecutorResult> {
355 const { device, provider, ...installOptions } = options ?? {};
356 const resolved = resolveTransferProvider(device, provider);
357 const install = resolved?.install;
358 if (install) {
359 return await withoutCommandExecutorOverride(async () => await install(apkPath, installOptions));
360 }
361 const exec = resolved?.exec;
362 if (!exec) {
363 throw new AppError('COMMAND_FAILED', 'Android adb install requires an adb provider');
364 }
365 const { installArgs, execOptions } = normalizeAndroidAdbInstallOptions(installOptions);
366 return await withoutCommandExecutorOverride(
367 async () => await exec(['install', ...installArgs, apkPath], execOptions),
368 );
369}
370
371function resolveTransferProvider(
372 device: DeviceInfo | undefined,

Callers 4

installAndroidAppFilesFunction · 0.90
installFunction · 0.90

Calls 4

resolveTransferProviderFunction · 0.85
installFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…