Glossary¶
Technical terms used in this documentation and in the code. In alphabetical order.
AID¶
Android ID — a fixed UID reserved by AOSP for specific system roles.
Examples: 0 = root, 1000 = system, 1001 = radio, 1010 = wifi, 2000 =
shell. Apps you install start at 10000 (u0_a0, u0_a1, ...). user-list
knows these names via the AID_NAMES table.
AnyDesk¶
Remote desktop app. Useful when the device screen works but you don't want to /
can't be physically present. Requires SystemUI and launcher to be active — if
you disabled them via appctl --profile minimo, AnyDesk stops working.
appctl --profile ui re-enables them.
AOD / Doze¶
Always-On Display / Doze — Android power-saving modes where the screen
shows minimal info (time, notifications) at intervals. screen-state counts
these states as "off" (not as "on").
bootloop¶
State where the device reboots continuously without reaching the launcher. Headless Lab is designed to never cause a bootloop — no boot hook exits with an error. See Troubleshooting for recovery.
cmd vs pm¶
pm is the legacy PackageManager frontend. cmd package list is the new
frontend. Both work; pm is more universally available.
dumpsys¶
Android command that prints the state of a system service. Used by almost every tool:
dumpsys power→ screen state (mWakefulness), stay-awake;dumpsys battery→ level, current, health;dumpsys input→ input devices recognized by Android;dumpsys activity activities→ foreground activity.
Requires root for most useful output.
Ghost touch¶
Phantom touches — the screen registers touches no one made, usually due to a
cracked glass or a touch controller issue. touch-ctl off solves this by
disabling the touchscreen when you only use the device via SSH.
input keyevent¶
Android command that sends a key event. Useful codes:
| Code | Name | Effect |
|---|---|---|
3 |
KEYCODE_HOME |
home button |
4 |
KEYCODE_BACK |
back button |
26 |
KEYCODE_POWER |
power button (toggles) |
220 |
KEYCODE_BRIGHTNESS_DOWN |
lower brightness |
221 |
KEYCODE_BRIGHTNESS_UP |
raise brightness |
223 |
KEYCODE_SLEEP |
turn screen off (idempotent) |
224 |
KEYCODE_WAKEUP |
turn screen on (idempotent) |
KEYCODE_WAKEUP / KEYCODE_SLEEP¶
Designed for automation. Unlike KEYCODE_POWER (which toggles), these are
idempotent: WAKEUP always wakes, SLEEP always sleeps, regardless of
prior state. screen-toggle uses them as the first choice.
lz4 / zstd / lzo¶
Compression algorithms supported by ZRAM:
| Algorithm | Typical ratio | CPU | Recommendation |
|---|---|---|---|
lzo |
~2.0x | very low | legacy, avoid |
lzo-rle |
~2.0x | very low | legacy |
lz4 |
~2.5x | low | recommended default |
zstd |
~3.0x–3.5x | medium | if you have CPU to spare |
On ARM 32 bits with 2 GB of RAM, lz4 is the sweet spot — reasonable
compression with minimal impact on swap access time.
Magisk¶
Root framework for Android. Keeps the system partition intact (doesn't modify
/system directly) and patches boot.img to inject its daemon. Features
relevant to Headless Lab:
- grants/denies root per app (Superuser);
- runs scripts in
/data/adb/post-fs-data.d/(right after mounting/data); - runs scripts in
/data/adb/service.d/(after boot completes); - has modules for system mods.
mknod¶
Unix command that creates a "device node" — a special file in /dev that the
kernel uses to talk to hardware. Syntax:
touch-ctl recreates the /dev/input/eventN node via mknod with the
major:minor read from sysfs, to restore touch without rebooting.
mWakefulness¶
Internal property of Android's PowerManager. Values:
Awake— screen on and active;Asleep— screen off;Dreaming— screensaver active (daydream);Dozing— AOD or Doze active.
screen-state reads this property via dumpsys power.
PEP 668¶
Python PEP that prevents direct pip install in system-managed environments
(starting with Python 3.11). In Termux, manifests as
error: externally-managed-environment. Solution: pip install --break-system-packages.
pm disable-user / pm enable¶
Android PackageManager commands. disable-user --user 0 <pkg> hides the app
from the main user (UID 0) but keeps the APK installed. enable
re-enables it. Reversible — preferred over uninstall for debloat.
RSS¶
Resident Set Size — amount of physical RAM used by a process (not counting
swap). user-list sums the RSS of all processes in a UID to show "how much
RAM this user is consuming". Unit: KB.
su -c¶
su (Magisk) syntax to run a command as root:
Unlike sudo CMD (Linux desktop), su -c accepts a full shell string.
Headless Lab tools pass the command in a single string.
swapfile¶
File at /data/swapfile used as traditional swap. Slower than ZRAM (flash
writes vs. compressed RAM) but:
- survives reboot (until re-enabled);
- can be large (limited to 40% of free
/data); - doesn't consume RAM for compression.
createswap uses priority 10 — only kicks in when ZRAM fills up.
swappiness¶
Linux kernel parameter (0–100) that controls how aggressively the kernel moves pages to swap vs. discards file cache.
0— almost never swap (prefers discarding cache);60— default;100— always swap.
For a server with little RAM and lots of swap (ZRAM), values 60–100 work well. For devices with lots of RAM, 10–30 reduces unnecessary swap.
sysfs¶
Virtual filesystem of the Linux kernel mounted at /sys. Exposes hardware
state and device configuration as text files. Used by Headless Lab at:
/sys/class/input/event*/device/name— input device names;/sys/class/input/event*/dev— major:minor;/sys/block/zram0/comp_algorithm— compression algorithm;/sys/block/zram0/disksize— ZRAM size.
SystemUI¶
Android component that renders the status bar, notifications, navigation bar
(gestural or 3-button), quick settings, and wallpaper. Package:
com.android.systemui. If you disable it (via appctl --profile minimo), you
lose all of that — the device is left with just the wallpaper and apps. Useful
for pure headless mode. Re-enable with appctl --profile ui or
appctl --repair --all.
Termux¶
App that provides a Linux environment (shell, Python, etc.) inside the Android app sandbox. Not an emulator — it's real Linux running inside Android's user space, no VM. Recommended version: F-Droid or GitHub releases (the Play Store one is obsolete).
UID / u0_aNN¶
User ID — in Android, each installed app runs under a unique UID. System
apps have fixed UIDs (0, 1000, 1001...). Apps you install start at 10000 and
are shown as u0_a0, u0_a1, ..., u0_a200, etc. Termux without root runs
as one of these (u0_aNN); with root, becomes uid=0.
ZRAM¶
Block device (usually /dev/block/zram0) that works as swap inside RAM
itself, compressing pages with lz4/zstd. Advantages:
- doesn't write to flash (less wear);
- much faster access than swapfile;
- compresses 2x–3.5x (a 4 KB page takes 1–2 KB).
Disadvantages:
- limited by total RAM (can't have ZRAM larger than ~50% of RAM without pressure);
- consumes CPU to compress/decompress.
createswap prioritizes ZRAM (100) over swapfile (10).
See also¶
- Architecture — where each term fits in the flow.
- Tools — practical usage.