Skip to content

user-list

Lists Android UIDs (users) with their packages, processes, and RAM usage. Replaces the old list-users and fixes three bugs in the original:

  1. the old version did id u0_aN in a loop β€” bionic libc always responds, so it listed all 201 UIDs even the non-existent ones;
  2. u0_a0..200 left out most apps (UIDs go above 200);
  3. su - user -c is not supported by Magisk's su.

The current version pulls real UIDs from PackageManager (pm list packages -U) and shows what each user is running via ps.

Basic usage

user-list                    # all UIDs, sorted by UID
user-list -3                 # only your installed apps
user-list -s                 # only system UIDs
user-list -d                 # only UIDs with disabled packages
user-list -r                 # only those with running processes
user-list -r --top 15        # top 15 by RAM
user-list -f google          # filter by "google" (package/user/process)
user-list --sort mem         # sort by memory (heaviest first)
user-list --json             # JSON output for scripts
user-list --help

Filters

Flag What it does
-3, --user-apps only your installed app UIDs (not system)
-s, --system-apps only system UIDs (root, system, radio, etc.)
-d, --disabled only UIDs with at least one disabled package
-r, --running only those with running processes
-f TEXT, --filter TEXT filter by user, package, or process (case-insensitive)
--top N show only the top N results
--sort {uid,name,mem,procs} sort order (default: uid)
--json JSON output

Filters combine: user-list -3 -r --sort mem --top 10 = "my apps currently running, top 10 by RAM".

Sort order

Value What
uid by numeric UID (default)
name by first package or user name
mem by total RSS (most RAM first)
procs by process count (most processes first)

The table

πŸ‘₯ Android users β€” Unisoc Lab
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”
β”‚ User     β”‚ UID  β”‚ Package                          β”‚ Proc β”‚ RAM   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ πŸ€– root  β”‚    0 β”‚ (no package)                     β”‚   18 β”‚ 142 MBβ”‚
β”‚ πŸ€– systemβ”‚ 1000 β”‚ android +12                      β”‚   54 β”‚ 380 MBβ”‚
β”‚ πŸ“± u0_a123β”‚ 10123β”‚ com.google.android.youtube       β”‚    3 β”‚  72 MBβ”‚
β”‚ πŸ“± u0_a87 β”‚ 10087β”‚ com.termux                       β”‚    2 β”‚  18 MBβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜

42 UIDs  β€’  18 your apps  β€’  6 system  β€’  3 disabled  β€’  12 running (612 MB)
πŸ€– system  πŸ“± installed app  βœ– all packages disabled  +N = other packages in same UID

Symbols:

  • πŸ€– system, πŸ“± installed app
  • βœ– next to package = all packages of this UID are disabled
  • +N = the UID has N other packages besides the first shown

RAM uses colors: green < 150 MB, yellow 150–400 MB, red > 400 MB.

--json

Structured output for monitoring scripts:

{
  "method": "su",
  "count": 12,
  "users": [
    {
      "uid": 10123,
      "user": "u0_a123",
      "pkgs": ["com.google.android.youtube"],
      "system": false,
      "disabled": 0,
      "procs": 3,
      "rss_kb": 73728,
      "top_proc": "com.google.android.youtube"
    }
  ]
}

method can be su, sudo, or sem root (no root). With no root:

  • some packages from other apps are invisible (Android hides them);
  • processes are partially visible;
  • rss_kb may be incomplete.

Android fixed UIDs (AID)

user-list knows the AOSP reserved UIDs:

UID Name What
0 root superuser
1000 system system server
1001 radio telephony
1002 bluetooth bluetooth
1004 input input devices
1005 audio audio
1006 camera camera
1010 wifi wifi
1013 media media
1019 drm DRM
1021 gps GPS
2000 shell shell (ADB/Termux without root)
10000+ u0_aN installed apps (N = UID βˆ’ 10000)

The full table is in the source code (AID_NAMES). For humans, Termux without root runs as u0_a87 (or similar) β€” don't confuse with shell (2000).

Why this is useful

  • find RAM hogs: user-list -3 --sort mem --top 10 shows which of your apps are eating the most;
  • confirm debloat worked: user-list -d should list the apps appctl disabled;
  • discover zombie apps: user-list -r -f <package> confirms whether an app you thought you disabled still has a running process;
  • monitor usage: user-list --json in a Prometheus/node_exporter script.

Exit codes

Code Meaning
0 OK (even if the filter returned nothing)
1 couldn't collect data (no root and even direct pm failed)
64 invalid usage

See also

  • appctl β€” disable/enable apps that show up in user-list.
  • Automation β€” export user-list --json to an endpoint.
  • Glossary β€” UID, AID, RSS, PackageManager.