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:
- the old version did
id u0_aNin a loop β bionic libc always responds, so it listed all 201 UIDs even the non-existent ones; u0_a0..200left out most apps (UIDs go above 200);su - user -cis not supported by Magisk'ssu.
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_kbmay 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 10shows which of your apps are eating the most; - confirm debloat worked:
user-list -dshould list the appsappctldisabled; - 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 --jsonin 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 --jsonto an endpoint. - Glossary β UID, AID, RSS, PackageManager.