ByteScope

am force-stop

changes the device

Kills every process and service belonging to one app.

Command
adb shell am force-stop
Commands
Activities and intents (am)
Risk
changes the device

Syntax

am force-stop <package>

Examples

  • am force-stop com.example

    Stop a misbehaving app without uninstalling or clearing it.

  • top -b -n 1 -m 10

    Find what is actually burning CPU before you stop anything.

Reading the output

Normally nothing. Treat silence as success and any `Error:`, `Exception` or permission line as failure — and if you want proof, look for the app's processes in `top` afterwards rather than trusting the absence of output.

Output fields

FieldMeaning
(no output)The command ran.
Error: …The package could not be resolved, or the call was refused.

What access it needs

No root, no `adb root`, no `su`: an authorised `adb` connection is the whole requirement. `am force-stop` reaches `ActivityManagerService.forceStopPackage`, which checks the caller for `android.Manifest.permission.FORCE_STOP_PACKAGES` and throws otherwise; the Shell package declares exactly that permission in its own manifest (`packages/Shell/AndroidManifest.xml`), which is why the command works from a cable and from almost nowhere else. The same manifest is what makes the default reach wider than most people expect. It also holds `INTERACT_ACROSS_USERS_FULL`, and `runForceStop` starts with its user id set to `UserHandle.USER_ALL`, narrowing only when you pass `--user`. So the plain one-argument form does not stop the app for the person looking at the screen — it stops it in every Android user on the device at once: the work profile, a secondary user, a cloned instance of the same app. If you meant only the user in front of you, name it. Nothing else stands between you and the kill: there is no confirmation, no dry run, no per-package allowance you can revoke, and the platform will not stop you force-stopping a system app. On a user build `adb root` is refused anyway, and it would buy you nothing here, because shell already holds the permission the call demands.

Failure messages, decoded

MessageMeaning
Error: Unknown option: --user0`runForceStop` accepts exactly one option, `--user`. Anything else is echoed on stderr and the method returns -1 **before** calling `forceStopPackage`, so a joined `--user0`, a `-u` abbreviation or a stray `--all` leaves the app running while the command reads like a warning rather than a refusal. Check the exit status, not the tone of the line.
Exception occurred while executing 'force-stop':A `Throwable` escaped `onCommand`; stderr carries a blank line, this banner and the trace. `java.lang.IllegalArgumentException: Argument expected after "force-stop"` means no package name was given. A `java.lang.SecurityException` naming `android.permission.FORCE_STOP_PACKAGES` means the call did not come from shell or root, which over a cable normally means you are inside `run-as` and no longer uid 2000.
Unknown command: force stopThe hyphen is part of the subcommand name. Quoted or split, `am` sees `force` and `handleDefaultCommands` prints this on **stdout**, returning -1 without touching any process. It looks nothing like the silence a successful force-stop produces, which is the one good thing about it.
cmd: Can't find service: activity`am` is a wrapper around `cmd activity`, and `cmd` could not find that service in the service manager. Nothing was stopped. Expected during boot, before `system_server` publishes `activity`; it is not a sign that the package name was wrong.

What it changes, and the way back

Nothing is deleted and the app starts again the next time it is launched or a broadcast wakes it — but unsaved state in its process is gone, and the alarms and jobs it had scheduled are cancelled until it runs again. There is no undo command; the cure is to open the app.

Version and vendor notes

  • Force-stopping from a process table sorted by CPU is an easy mis-click, and the app you meant to leave alone is the one that loses its unsaved state.
  • This is not the same as disabling: the app is free to start again at any moment.

We have a UI for this

Android System Monitor runs this command over USB and parses what comes back — a Chromium browser, no SDK, nothing uploaded.

Open Android System Monitor

Related commands

Commands that turn up in the same session as am force-stop.

CommandWhat it does
topA one-shot process table: CPU share, memory, state and command line.
dumpsys meminfoWhich processes are using the most memory, measured as proportional set size.
am startStarts an activity by component or by intent — the fastest way to test whether a deep link resolves.

More Activities and intents (am) commands

CommandWhat it does
am broadcastSends a broadcast intent, which is how SystemUI demo mode and other platform receivers are driven from a shell.

Running these commands, when they need root, why output differs between phones and running them from a browser are covered once in the adb shell command reference.