Troubleshooting¶
Diagnosis by symptom. Each section lists the most likely cause, how to confirm, and how to fix — with copy-paste commands.
If the device is bootlooping
Jump straight to Bootloop. If you don't have SSH/ADB access,
hold power ~10 s to force a reboot; enter recovery (Volume Up + Power) and
adb sideload a ROM/factory image if needed.
Symptom index¶
- No root
- Touch unresponsive after
touch-ctl off - Swap/ZRAM won't activate
- Bootloop after
--install-boot - SystemUI gone (no bar, no notifications)
- Screen won't change state
- appctl doesn't list apps
richwon't install- Commands vanish after reboot
No root¶
Symptom: every tool says "no root" or asks you to open Magisk.
Confirm:
Most likely cause: Magisk hasn't granted access to Termux.
Fix:
- Open the Magisk app → Superuser tab.
- Find Termux in the list.
- Tap the key icon and set to Allow.
- (optional) Tap the settings next to Termux and set request timeout: 10 minutes or forever — so
crondoesn't hang. - Test again:
su -c idshould printuid=0(root).
If Magisk doesn't show up in the app:
- Magisk may be hidden (renamed to something like "com.apple.magisk" or similar). Open via the disguised icon.
- Or root was removed by an OTA update. Reinstall Magisk via recovery.
Touch unresponsive¶
Symptom: after touch-ctl off, the screen doesn't react to touches.
This is expected behavior. off removes the /dev/input/eventN node;
Android stops reading the touchscreen. The screen still shows an image —
only touch is disabled.
Recover (in order of preference):
# 1. via SSH (already connected)
ssh user@ip 'touch-ctl on'
# 2. via ADB
adb shell touch-ctl on
# 3. via physical keyboard (OTG or Bluetooth) — open Termux and type
touch-ctl on
# 4. last resort: reboot
# hold power ~10 s; on boot /dev/input is recreated and touch returns
If touch-ctl on fails with "couldn't recreate the node":
# read the saved state
cat /data/local/tmp/touch-ctl.state
# should show EVENT=eventN DEVNUM=maj:min MODE=660 OWNER=0:1004
# recreate manually (replace the values)
su -c 'mknod /dev/input/eventN c MAJ MIN && chmod 660 /dev/input/eventN && chown 0:1004 /dev/input/eventN'
If you don't remember the device name:
su -c 'for d in /sys/class/input/event*/; do echo "$(basename $d): $(cat $d/device/name 2>/dev/null)"; done'
Look for something like touchpanel, fts_ts, goodix_ts, sec_ts — your
touchscreen's name.
Swap/ZRAM won't activate¶
Symptom: createswap --setup-zram 1G fails, or createswap --status
shows "State: ❌ Not active".
Confirm:
cat /proc/swaps # should list /dev/block/zram0
ls -l /dev/block/zram0 # exists?
cat /sys/block/zram0/disksize # 0 = not configured
Causes and fixes:
| Cause | Symptom | Fix |
|---|---|---|
| ZRAM not supported by kernel | cat /proc/crypto doesn't list lz4 |
See supported algorithms: cat /sys/block/zram0/comp_algorithm |
mkswap failed |
createswap log |
Run with --verbose if available, or switch algorithm (--algo lzo) |
swapon denied (root) |
"Operation not permitted" | Confirm you're root: id -u should be 0 |
| Another swap device already active | /proc/swaps shows another entry |
createswap --clear all first |
Not enough free RAM for swapoff |
createswap --clear aborts |
Free up RAM (close apps), try again |
ZRAM disappears after boot:
- You didn't run
--install-boot. Do:
Boot hook ran but ZRAM didn't come up:
# check the log
cat /data/local/tmp/createswap-boot.log
# force a manual re-execution of the hook
su -c 'sh /data/adb/post-fs-data.d/createswap.sh'
Bootloop¶
Symptom: device reboots in a loop, never reaches the launcher.
If you have ADB:
# enter recovery (Volume Up + Power)
# then, in recovery, enable ADB sideload or shell
adb shell
# disable the createswap hook
touch /data/local/tmp/createswap.disable
# OR remove the hook file
rm /data/adb/post-fs-data.d/createswap.sh
Reboot. If the bootloop was caused by the hook, it should boot normally.
If you don't have ADB (Magisk is hidden and recovery is stock):
- Enter recovery (Volume Up + Power).
- Do "Wipe cache partition" (NOT wipe data).
- Try reboot. If it persists:
- "Reboot to bootloader" → fastboot → reflash stock
boot.img(without Magisk). - Reinstall Magisk via patch of the boot.img.
If the bootloop started after appctl --profile minimo:
The minimo profile disables SystemUI. The device is probably not
bootlooping — it's waiting for SSH because it has no UI anymore. Connect via
SSH/ADB and run:
SystemUI gone¶
Symptom: no status bar, no navigation buttons, no notifications. The screen shows only the wallpaper.
Cause: you (or a profile) disabled SystemUI or one of its components.
Confirm:
Fix:
appctl --repair --all
# or, just SystemUI:
pm enable com.android.systemui
am force-stop com.android.systemui
# SystemUI restarts on its own
If the launcher is also gone:
Screen won't change¶
Symptom: screen-toggle --off says "screen didn't change even after power button".
Causes:
- App in foreground blocks sleep (video, navigation, call).
- Stay awake active in Developer options → screen stays on while charging.
- Accessibility / kiosk mode preventing
KEYCODE_SLEEP.
Confirm (2):
Fix:
# disable "stay awake"
settings put global stay_on_while_plugged_in 0
# force sleep
input keyevent KEYCODE_SLEEP # 223
# or power button
input keyevent KEYCODE_POWER # 26 (not recommended, toggles)
If an app is blocking, force-stop:
# see who's in foreground
dumpsys activity activities | grep mResumedActivity
# force-stop the app
am force-stop <package>
appctl doesn't list¶
Symptom: appctl --list shows an empty list.
Confirm:
Causes:
- No root and Termux can't see packages: rare, but on Android 13+ Go,
pmwithout root sometimes only lists Termux's own apps. pmbinary corrupted: rare.
Fix:
su -c 'pm list packages' # confirm pm works with root
# if it comes back empty even with root, try:
su -c 'cmd package list packages'
If it persists, appctl likely needs to be re-run with explicit root via
su -c 'appctl --list'.
rich won't install¶
Symptom: pip install rich fails with error: externally-managed-environment.
Cause: PEP 668 — pip refuses to install into a system-managed environment.
Fix:
pip install --break-system-packages rich
# or, if you use a virtualenv:
python -m venv ~/venv
source ~/venv/bin/activate
pip install rich
# but you need to activate the venv before each use
Commands vanish¶
Symptom: after reboot, appctl etc. say "command not found".
Confirm:
Causes:
- Clone moved: you moved
~/headless-labto another folder; the symlinks broke. - Clone in
~/storage: shared storage (FUSE) doesn't allow executing scripts —install.shwarns about this.
Fix:
# move the clone into ~
mv ~/storage/headless-lab ~/headless-lab
# reinstall
cd ~/headless-lab && ./install.sh
If you can't move it (permissions), re-clone: