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

Function uninstallAndroidApp

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

Source from the content-addressed store, hash-verified

716}
717
718async function uninstallAndroidApp(device: DeviceInfo, app: string): Promise<{ package: string }> {
719 const resolved = await resolveAndroidApp(device, app);
720 if (resolved.type === 'intent') {
721 throw new AppError('INVALID_ARGS', 'App uninstall requires a package name, not an intent');
722 }
723 const result = await runAndroidAdb(device, ['uninstall', resolved.value], {
724 allowFailure: true,
725 });
726 if (result.exitCode !== 0) {
727 const output = `${result.stdout}\n${result.stderr}`.toLowerCase();
728 if (!output.includes('unknown package') && !output.includes('not installed')) {
729 throw new AppError('COMMAND_FAILED', `adb uninstall failed for ${resolved.value}`, {
730 stdout: result.stdout,
731 stderr: result.stderr,
732 exitCode: result.exitCode,
733 });
734 }
735 }
736 return { package: resolved.value };
737}
738
739type BundletoolInvocation =
740 | { cmd: 'bundletool'; prefixArgs: readonly string[] }

Callers 1

reinstallAndroidAppFunction · 0.85

Calls 2

runAndroidAdbFunction · 0.90
resolveAndroidAppFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…