android-debloat
Skill2 starsChanged 14 days agoMITView on GitHub
De-bloat, speed up, and maintain Android phones over adb without root. Use when diagnosing device slowness, lag, storage pressure, or battery drain, when preinstalled bloatware should be disabled, when media should move to a memory card, or for adb-based Android maintenance, diagnostics, or rollback of phone changes. Covers diagnosis (RAM/swap, wakeup floods, disk fullness), safe package disabling, verified bulk file moves, and rollback discipline.
In this repository31 other files it gives its agents.
- arch-linux-cachyosSkill
- beansSkill
- chezmoi-workflowsSkill
- coding-rulesSkill
- context7Skill
- docker-compose-setupSkill
- audioSkill
- deploymentSkill
- ecsSkill
- game-loopSkill
- inputSkill
- physicsSkill
- renderingSkill
- resourcesSkill
- ebitenSkill
- ebook-convertSkill
- gitSkill
- go-browser-testsSkill
- go-devSkill
- go-htmx-frontendSkill
- go-setupSkill
- go-testsSkill
- interactive-browser-testingSkill
- keep-on-goingSkill
- mcpcSkill
- obsidian-vault-triageSkill
- pixellabSkill
- playwright-mcpSkill
- public-repo-maturitySkill
- researchSkill
- skill-craftSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Run all four; each maps to a distinct root cause:
- Very specific: line 31
NEVER pm uninstall system-critical pkgs (SystemUI, phone, providers).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Android debloat & speed over adb (no root)
Works on any Android 9+ phone with USB debugging. Verify on the actual device every time, vendor behavior differs (Sony, Samsung, Xiaomi remove features silently).
Diagnose before touching anything
Run all four; each maps to a distinct root cause:
adb devices -l # must say "device", not "unauthorized"
adb shell df -h /storage/emulated | tail -1 # >90% full → Android itself degrades
adb shell top -b -n 1 | head -8 # kswapd0 high CPU = RAM starvation (THE hidden killer)
adb shell dumpsys meminfo | grep -E "Free RAM|ZRAM" # big ZRAM/swapped = swap tax on every app switch
adb shell dumpsys alarm | grep -B1 -A3 wakeups # who wakes the CPU (battery + lag)Leading insight: kswapd burning CPU means RAM starvation, not CPU weakness. Fix = uninstall big unused apps + reboot (clears swap). No amount of "cleaner" apps helps.
Safe-action ladder (most reversible first)
adb shell pm trim-caches 512Gpurges all app caches instantlyadb shell pm disable-user --user 0 <pkg>reversible bloat kill (pm enable <pkg>reverts). Prefer over uninstall.adb shell pm uninstall --user 0 <pkg>user apps the user names explicitly (Play Store reinstallable)adb shell settings put global window_animation_scale 0.5(+transition_animation_scale,animator_duration_scale) visible snappiness,1.0reverts- NEVER
pm uninstallsystem-critical pkgs (SystemUI, phone, providers). If UAD says Unsafe/Expert, skip.
Debloat database
Pull UAD-ng lists: raw.githubusercontent.com/.../main/resources/assets/uad_lists.json (5k+ pkgs, removal: Recommended/Advanced/Expert/Unsafe). Cross-reference with adb shell pm list packages -s, then apply user-context overrides: keep aptX/BT codecs if BT headphones, keep SIM/uim on modem-dependent devices, keep anything the user's apps depend on. Recommended ≠ always safe for THIS user.
Log every change to a file on the phone (/data/local/tmp/debloat.log), the rollback ledger.
Bulk file moves to microSD (the slow path that works)
microSD over adb is ~2–4 MB/s (FUSE + exFAT). Never block an interactive session:
- Push a shell script to
/data/local/tmp/, run detached:adb shell 'nohup sh script.sh >/dev/null 2>&1 &' - Script does per-item:
cp -a→ compare file count AND byte totals → delete source only on exact match → append verdict to a log - Poll the log from the host. No reboot while it runs (kills the job).
- MTP won't show adb-copied files in
Music/DCIM/Pictures(different uid); the files are fine; check with an on-device file manager.
Hard limits (verify per device, don't assume): WhatsApp media and app cannot move to SD (hardcoded + vendor killed adoptable storage on Android 9+). Google Maps offline areas CAN move: in-app → Offline maps → ⚙ → Storage preferences → SD card (requires re-download).
Known traps
- Phone toybox
sortlacks-h→ usedu -k+sort -rn dumpsys diskstatssize arrays are positional, never map indexes to package names (mis-blames apps); usedu -k -d 1 /storage/emulated/0/Android/mediaandAndroid/datainsteadpm clearfrees ~0 when the bloat lives inAndroid/media(shared storage), not app-private/data/dataps -A | grep cpmay miss busybox cp; usepidof cp- Syncthing
.stfoldermarkers = active sync, check sync direction before deleting on either side - Vendor telemetry (Sony devicemonitor/crashmonitor, FB services) can fire 1k–7k alarms/day; disabling them is the cheapest battery+CPU win
Per-phone state
Device-specific ledgers (what was changed, rollback list, storage map) live in per-project docs. Check for a similar dir before re-diagnosing a phone already worked on.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

