Manage packages
adb_appManage Android packages over ADB with dry-run defaults, protected-package checks, network guard, and one-call restore to inspect, launch, stop, disable, uninstall, back up, or restore apps.
Instructions
Package operations with guard rails: inspect, launch, stop, clear, disable, uninstall, back up and restore packages. Use it rather than adb_shell or adb_uninstall for package changes. Every action that changes packages defaults to dry_run=true. A protected set derived from the device (launcher, active IME, installer, WebView provider, role holders, account packages) aborts the whole call on any overlap, and has no override. A network guard refuses disable, uninstall, stop and clear while the package is serving an off-device client, naming the port and the peer. Only force_network=true lifts it; force covers a failed APK backup and nothing else. An account canary between batches rolls a batch back and stops on a drop. Everything applied goes into a snapshot, so action=restore undoes it. mode=uninstall also needs the server option allow_uninstall and a successful APK backup. action=launch also accepts uri and/or intent_action for an intent or deep link; CALL, CALL_PRIVILEGED and CALL_EMERGENCY are refused while allow_shell is false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | action=list only: case-insensitive substring filter | |
| uri | No | action=launch only: deep-link / intent data URI (am start -d). Its presence, together with intent_action, selects the intent-based launch instead of resolving the package's main activity. | |
| mode | No | How to remove: disable (default) is undone by action=enable or restore; uninstall needs allow_uninstall. | |
| force | No | Proceed even if the APK backup failed. Off by default. It does not affect the network guard; see force_network. | |
| scope | No | action=backup only: what to back up when packages is omitted (default user) | |
| store | No | Where snapshots and APK backups live: by default the snapshot store (setting store). Another path must be inside file_roots. | |
| action | Yes | list/info/protected/state only read. launch/stop/clear act at once (clear defaults to dry_run), stop/clear under the network guard. disable/uninstall/enable/restore default to dry_run. | |
| backup | No | Pull APKs before removing. Default true for uninstall, false for disable. | |
| canary | No | Check the account count and the launcher between batches, default true. Turning it off removes the only automatic check for a latent breakage. | |
| extras | No | action=launch only: intent extras. string -> --es, boolean -> --ez, int32 integer -> --ei, larger integer -> --el; anything else is refused by key name. A JSON-stringified object is accepted too. | |
| filter | No | action=list only, default user | |
| serial | No | Device serial from adb_devices. Optional when exactly one device is connected. | |
| dry_run | No | Default true for state-changing actions. Set false to actually apply. | |
| packages | No | Package name or array of package names. For action=launch with uri/intent_action, at most one package is accepted (used as -p to narrow the resolver); it is otherwise optional there. | |
| batch_size | No | Packages per batch between canary checks, default 5, max 25 | |
| force_network | No | Override the network guard for disable, uninstall, stop and clear: act on a package that is currently serving an off-device client. It does NOT override the protected set. Off by default. | |
| intent_action | No | action=launch only: intent action, default android.intent.action.VIEW when uri is set. Must match [A-Za-z0-9_.]+. See the CALL refusal note above. |