Skip to content

FAQ

Frequently asked questions. If yours isn't here, open an issue.

Does it work without root?

No, for most things. The tools touch pm, dumpsys, input keyevent, mknod, and sysfs — all of which require root.

Exceptions:

  • battery works partially without root (shows level, temperature, voltage, but not current/cycles);
  • user-list works partially (lists Termux's own apps, some visible packages, but not all processes);
  • appctl --list reads only what Termux without root sees (short list).

If you don't have root, Headless Lab won't help you.

Does it work on any Android?

Probably, if it's Android 10+ with Magisk root. But:

  • the appctl app catalog is specific to Samsung/Google Go — on other brands, most listed packages won't exist;
  • the touchscreen name (touchpanel) may differ — use --name or TOUCH_NAME;
  • Android 14+ may have changes to pm disable-user for some critical packages;
  • Android 12+ with PHA-AS (Play Health Auto-Protect) may re-enable apps you disabled, in some cases.

Reports from other devices are welcome in the issues.

Can I really use it as a 24/7 server?

Yes, that's the main use case. The author keeps a Galaxy A03 Core as a 24/7 SSH server for months with:

  • appctl --profile servidor-seguro applied;
  • createswap --setup-zram 1G --install-boot on boot;
  • touch-ctl off (cracked screen);
  • Termux sshd;
  • cron job of battery --json for alerts.

Battery ages faster in 24/7 use plugged into the charger — consider a charge limit (some devices support it via dumpsys battery setlevel with root, but that's invasive).

Will I lose data?

No, if you follow the rules:

  • appctl never uninstalls — only pm disable-user (reversible).
  • createswap writes to /data/swapfile (a new file, doesn't overwrite anything).
  • touch-ctl touches /dev/input/eventN (a device node, not data).

The only operation that deletes something is createswap --clear, which removes the swapfile (which you created) — it doesn't touch any of your data.

Even so: back up your data before testing.

How do I completely uninstall?

cd ~/headless-lab && ./install.sh --uninstall     # remove symlinks
createswap --clear all                             # remove swap/ZRAM
createswap --uninstall-boot                        # remove Magisk hook
rm -rf ~/.appctl                                    # remove snapshots
rm -f /data/local/tmp/touch-ctl.state
rm -f /data/local/tmp/createswap*.disable /data/local/tmp/createswap-boot.log
rm -rf ~/headless-lab                              # remove the clone

Apps disabled by appctl stay disabled — run appctl --profile restaurar-tudo before to re-enable everything, or re-enable manually with pm enable.

What ZRAM size should I use?

For 2 GB of RAM (the most common case): 1 GB (50%).

General rule:

  • 1 GB RAM → 50% (512 MB) ZRAM + 1 GB swapfile;
  • 2 GB RAM → 50% (1 GB) ZRAM + 1–2 GB swapfile;
  • 3 GB RAM → 33% (1 GB) ZRAM, swapfile optional;
  • 4+ GB RAM → 25% ZRAM, no swapfile.

ZRAM larger than 50% of RAM can worsen performance — you spend RAM storing the compressed pages and CPU compressing/decompressing.

lz4 or zstd?

  • lz4 — faster, ~2.5x compression. Recommended for ARM 32 bits and modest devices.
  • zstd — ~3.0x–3.5x compression but uses more CPU. Worth it if you have CPU to spare (Snapdragon 6xx+ on 64 bits).

Test with both:

createswap --setup-zram 1G --algo lz4
createswap --status
# then
createswap --clear zram
createswap --setup-zram 1G --algo zstd
createswap --status
# compare "Data → compressed" and "RAM consumed"

Can Magisk deny root to the tools?

Yes — the first time each one calls su, Magisk asks for permission on screen. If you're not looking (or if cron runs and the screen is off), it can hang.

Solution: in Magisk → Superuser → Termux → config, set the timeout to 10 minutes or forever, and mark Allow (not Ask). From then on, all tools work without prompts.

Is appctl --profile minimo safe?

It's reversible, but it will leave the device without a visual interface. Only use it if:

  • you have SSH working (or ADB);
  • you know you'll run appctl --profile ui or appctl --repair --all to revert.

Without SSH/ADB, after minimo you have no way to access the device via the screen (only via OTG/Bluetooth physical keyboard or recovery reboot).

How do I contribute?

Issues and PRs are welcome. Before opening a PR:

  1. run bash -n bin/<your_script> to validate Bash syntax;
  2. run python3 -m py_compile bin/<your_script> to validate Python;
  3. test with --dry-run / -n where applicable;
  4. don't paste logs/prints with serial, IMEI, MAC, IP, network name or device name — anonymize first.

For new devices: a report "works on X model, Android Y, root Z" with the packages from appctl --list (anonymized) is already a valuable contribution.

Is the project affiliated with Samsung/Google/Magisk/Termux?

No. Headless Lab is independent. Trademarks belong to their owners. The author is not affiliated with any of them.

See also