(device: DeviceInfo, app: string)
| 716 | } |
| 717 | |
| 718 | async 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 | |
| 739 | type BundletoolInvocation = |
| 740 | | { cmd: 'bundletool'; prefixArgs: readonly string[] } |
no test coverage detected
searching dependent graphs…