Skip to content
Back to search

android-adb-debloat

SkillWorks with Claude CodeGitHub

Audit, clean and debloat an Android phone over ADB via USB without root, using a strict read-only-first, approval-gated workflow with a full backup list and a restore log. Use this skill whenever the user wants to debloat, declutter, speed up, free storage on, remove bloatware or carrier/OEM apps from, or audit the apps on an Android phone using adb, pm uninstall, disable-user, or USB debugging — even if they only say "clean up my phone with adb" or "remove Samsung/Xiaomi/OnePlus bloat". Also use it when the user wants to restore packages they removed with adb.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/sharky412--android-adb-debloat/badge.svg)](/listings/sharky412--android-adb-debloat)

HTML

<a href="/listings/sharky412--android-adb-debloat"><img src="/api/listings/sharky412--android-adb-debloat/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

- **Claude.ai:** Settings → Capabilities → Skills → upload `android-adb-debloat.skill` from the [latest release](https://github.com/sharky412/android-adb-debloat/releases/latest) (or a zip of this folder). - **Claude Code:** `git clone https://github.com/sharky412/android-adb-debloat ~/.claude/skills/android-adb-debloat`

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 90 lines
  1. ---
  2. name: android-adb-debloat
  3. description: Audit, clean and debloat an Android phone over ADB via USB without root, using a strict read-only-first, approval-gated workflow with a full backup list and a restore log. Use this skill whenever the user wants to debloat, declutter, speed up, free storage on, remove bloatware or carrier/OEM apps from, or audit the apps on an Android phone using adb, pm uninstall, disable-user, or USB debugging — even if they only say "clean up my phone with adb" or "remove Samsung/Xiaomi/OnePlus bloat". Also use it when the user wants to restore packages they removed with adb.
  4. ---
  5. # Android ADB Debloat (no root)
  6. A safe, reversible, approval-gated workflow for auditing and debloating an Android phone over ADB.
  7. The whole design rests on one principle: **nothing on the phone changes until the user has seen the evidence and approved that specific batch.** Debloating mistakes range from mildly annoying (a missing app) to severe (bootloop, loss of calls/SMS, factory reset needed). Reading is cheap and safe; writing is not. So every phase gathers facts first, separates facts from guesses, and stops for approval before any write.
  8. ## Before you start: where do commands run?
  9. Work out which situation you are in before doing anything else:
  10. - **You can run `adb` yourself** (Claude Code, Cowork, or any agent with a local shell and the phone plugged into that machine): run the read-only commands directly.
  11. - **You cannot reach the phone** (claude.ai web/mobile, or any cloud sandbox — these have no USB access to the user's machine): say so plainly in one sentence, then give the user the commands or the bundled scripts to run locally, and ask them to paste or upload the output. Never pretend to have run a command.
  12. Either way, the approval gates below are identical.
  13. ## Phase 1 — Connection & backup (read-only)
  14. 1. **Check adb is installed:** `adb version`. If missing, give install steps for the user's OS:
  15. - Windows: `winget install Google.PlatformTools`, or the Platform Tools zip from developer.android.com/tools/releases/platform-tools
  16. - macOS: `brew install android-platform-tools`
  17. - Linux (Debian/Ubuntu): `sudo apt install adb` (may lag behind; the official zip is more current)
  18. 2. **Confirm connection:** `adb devices`. Interpret: `device` = OK; `unauthorized` = accept the RSA prompt on the phone; empty/`offline` = cable is charge-only, USB mode is "charging only", or a Windows driver is missing. If more than one device is listed, stop and ask which serial to use (then use `adb -s <serial>` everywhere).
  19. 3. **Identify the device:**
  20. `adb shell "getprop ro.product.manufacturer; getprop ro.product.brand; getprop ro.product.model; getprop ro.product.device; getprop ro.build.version.release; getprop ro.build.version.sdk; getprop ro.build.display.id; getprop ro.miui.ui.version.name; getprop ro.build.version.oneui"`
  21. Blank lines for the last two are normal (they only exist on MIUI/HyperOS and One UI).
  22. 4. **Export the backup list** before any change:
  23. `adb shell pm list packages -f -i -u --user 0 > installed_packages_backup.txt`
  24. plus `adb shell pm list packages -d --user 0 > disabled_packages_before.txt`.
  25. Windows PowerShell's `>` writes UTF-16; use `| Out-File -Encoding utf8 <file>` there.
  26. `scripts/audit_readonly.sh` does all of Phase 1 and Phase 2 data collection in one read-only run. Prefer offering it when the user is comfortable running a script.
  27. Tell the user clearly: **this list is not a data backup.** `pm uninstall --user 0` keeps the APK in the system partition (so it can be restored), but the app's data and logins are wiped, and a restore brings back the factory version, not Play Store updates.
  28. ## Phase 2 — Read-only audit & 3-tier categorization
  29. Collect (all read-only):
  30. | What | Command | Why |
  31. |---|---|---|
  32. | All packages + APK path + installer | `pm list packages -f -i -u --user 0` | Path under `/system`, `/product`, `/vendor`, `/system_ext` = preinstalled; `/data/app` = user-installed or updated system app |
  33. | System vs third-party | `pm list packages -s` / `-3` | Quick split |
  34. | App, data and cache sizes | `dumpsys diskstats` | Has parallel arrays: Package Names, App Sizes, App Data Sizes, Cache Sizes |
  35. | Last used | `dumpsys usagestats` | Look for `lastTimeUsed`; format varies by Android version and OEM |
  36. | Storage overview | `df -h /data` and `du -sh /sdcard/*` | Where the space is |
  37. | Large files / stray APKs | `find /sdcard -type f -size +100M` and `find /sdcard -iname '*.apk'` | Tier 2 file candidates |
  38. Then categorize. Read `references/tiering-guide.md` before tiering — it contains the do-not-touch list, known-risky OEM packages, and common bloat patterns.
  39. - **Tier 1 — Safe to remove / bloatware:** carrier apps, OEM duplicates of Google apps, preloaded third-party apps (Facebook stubs, Netflix activation, LinkedIn, etc.), ad and analytics packages. Only put a package here if you can explain what it is and why removing it is safe *on this OEM*. If unsure, it goes to Tier 2 with a note, never Tier 1.
  40. - **Tier 2 — Storage hogs & unused (review needed):** user apps not used in 30+ days, large caches, large files and stray APKs in `/sdcard`, and any preinstalled package you could not confidently classify.
  41. - **Tier 3 — Do not touch:** core Android, Google Play Services / Play Store / GSF, telephony/SMS/IMS, Wi-Fi/Bluetooth/network stack, the active launcher, the only keyboard, WebView, permission controller, package installer, setup wizard, OEM framework/security packages. Explain briefly why for any non-obvious entry.
  42. **Evidence rules** (they matter because the user will act on this):
  43. - Label every claim as observed (from the dumps) or inferred (from package naming / general knowledge). A package name alone is a hint, not proof.
  44. - Usage stats are often incomplete after a reset, update, or OEM pruning. Say "no usage recorded" rather than "unused" when data is missing.
  45. - Sizes from `diskstats` are a snapshot and can be stale by hours; say so.
  46. - Never infer what a file in `/sdcard` contains from its name alone if it could be personal (photos, documents, WhatsApp media). Flag it; don't recommend deleting it.
  47. ## Phase 3 — Execution (only after explicit approval)
  48. 1. **Present Tier 1 and Tier 2** as tables: package/path, plain-English description, size, last used, confidence, and the risk if removed. Present Tier 3 as a short summary.
  49. 2. **Stop and wait.** The user approves specific packages or files, ideally in batches. "Remove all of Tier 1" is acceptable only if they say it explicitly after seeing the list. Approval for one batch does not carry over to the next.
  50. 3. **Remove approved packages** with `scripts/remove_approved.sh` (dry-run by default; `--apply` to act). For each package it:
  51. - refuses anything on the built-in do-not-touch list,
  52. - tries `pm uninstall --user 0 <pkg>`, and only if that fails, `pm disable-user --user 0 <pkg>`,
  53. - appends `timestamp | package | method | result` to `removed_packages_log.txt`.
  54. Removing one batch at a time and checking calls, SMS, Wi-Fi, Bluetooth and the launcher between batches makes any breakage easy to pin to a package.
  55. 4. **Approved files:** suggest `adb pull <path>` first if there is any chance they want it, then `adb shell rm "<exact path>"` per approved path only. Never use wildcards or `rm -r` on folders the user did not name exactly; `rm` over ADB is permanent (no recycle bin).
  56. 5. **Caches:** `pm trim-caches 999G` asks the system to clear cached data across apps and is safe. **Never use `pm clear <pkg>` to "clear cache"** — it wipes all of that app's data, like "Clear storage".
  57. 6. **Restore** anything with `scripts/restore_from_log.sh`, which runs `cmd package install-existing --user 0 <pkg>` for uninstalled packages and `pm enable --user 0 <pkg>` for disabled ones. Last resort if the phone misbehaves: a factory reset restores every user-0-removed package (and erases data).
  58. ## Phase 4 — Optional reversible tweaks (offer, don't apply)
  59. Record current values first with `settings get`, then offer:
  60. - Animation scales: `settings put global window_animation_scale 0.5`, `transition_animation_scale 0.5`, `animator_duration_scale 0.5` (revert with `1.0`).
  61. - Background process limit is in Developer options and resets on reboot — mention it, don't recommend it as a default.
  62. Avoid "tweaks" that are not reversible or are folklore (forced GPU rendering, forcing 4x MSAA, aggressive doze/whitelist edits) unless the user specifically asks and understands the trade-off.
  63. ## Response style
  64. - Commands: explain what each part does and point out assumptions (OS, shell, single device, Android version).
  65. - Never promise a speed or battery improvement; say what is likely and what isn't measured.
  66. - Keep the user in control: every write action is shown before it runs.
README.md · README · 65 lines
  1. # android-adb-debloat — a Claude skill
  2. [![Claude skill](https://img.shields.io/badge/Claude-skill-D97757)](https://claude.com/claude-code)
  3. [![Android](https://img.shields.io/badge/Android-ADB-3DDC84?logo=android&logoColor=white)](https://developer.android.com/tools/adb)
  4. [![No root](https://img.shields.io/badge/root-not%20required-blue)](#important-limitations)
  5. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
  6. Audit, clean and debloat an Android phone over ADB (USB, **no root**) with a strict
  7. **read-only first, approve every batch, log everything, restore anytime** workflow.
  8. ## What it does
  9. | Phase | What happens | Changes the phone? |
  10. |---|---|---|
  11. | 1. Connection & backup | Checks adb, the device, model/Android version; exports `installed_packages_backup.txt` | No |
  12. | 2. Audit & tiering | Collects package paths, sizes, caches, usage, large files; sorts into Tier 1 (bloat), Tier 2 (review), Tier 3 (do not touch) | No |
  13. | 3. Execution | Removes **only approved** packages with `pm uninstall --user 0` (fallback `disable-user`), logged to `removed_packages_log.txt` | Yes, after approval |
  14. | 4. Tweaks | Offers reversible tweaks like 0.5x animation scales | Only if accepted |
  15. ## Contents
  16. ```
  17. android-adb-debloat/
  18. ├── SKILL.md # Instructions Claude follows
  19. ├── README.md
  20. ├── LICENSE
  21. ├── references/
  22. │ └── tiering-guide.md # Do-not-touch list, risky OEM packages, common bloat
  23. └── scripts/
  24. ├── audit_readonly.sh # Phase 1 + 2 data collection (read-only)
  25. ├── remove_approved.sh # Dry-run by default; --apply to remove; built-in protected list
  26. └── restore_from_log.sh # Reverses removals from the log
  27. ```
  28. ## Installing the skill
  29. - **Claude.ai:** Settings → Capabilities → Skills → upload `android-adb-debloat.skill` from the
  30. [latest release](https://github.com/sharky412/android-adb-debloat/releases/latest) (or a zip of this folder).
  31. - **Claude Code:** `git clone https://github.com/sharky412/android-adb-debloat ~/.claude/skills/android-adb-debloat`
  32. ## Using the scripts directly
  33. Requirements: Android Platform Tools (`adb`) on your PATH, USB debugging enabled, and a bash shell
  34. (macOS/Linux terminal, or Git Bash on Windows).
  35. ```bash
  36. ./scripts/audit_readonly.sh # read-only audit -> adb_audit_<timestamp>/
  37. ./scripts/remove_approved.sh approved.txt # dry run
  38. ./scripts/remove_approved.sh approved.txt --apply # remove + log
  39. ./scripts/restore_from_log.sh removed_packages_log.txt
  40. ```
  41. ## Important limitations
  42. - `pm uninstall --user 0` does **not** free system-partition space; it hides the app for your user
  43. and removes its data/updates. Real space gains come from caches, user apps and files.
  44. - A restored app returns at its factory version with **empty data**.
  45. - A factory reset restores every package removed this way.
  46. - Claude on claude.ai (web/mobile) cannot reach your USB devices; there it hands you the commands
  47. and analyses the output you paste back. In Claude Code on your own machine it can run them directly.
  48. - Package lists in `tiering-guide.md` are heuristics. Always check against your own device.
  49. ## Disclaimer
  50. Provided as-is, without warranty. You are responsible for what you remove from your device.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.