Stock Android 6.0 on the Moto E2 uses approximately 450 MB of its 1 GB RAM before any third-party app runs. The gateway needs ~155 MB, Termux needs ~48 MB, and the OS floor (system_server + zygote + launcher) takes ~165 MB. That is already 368 MB with zero bloatware, leaving no margin. Every megabyte freed from stock packages directly determines whether the gateway can run without being killed by the low-memory killer.
Android provides pm uninstall -k --user 0 which removes a package for user 0 without needing root. The -k flag keeps the package data on disk (in case you want to reinstall). On Android 7+, the reverse command pm install-existing restores a user-uninstalled system package. But on Android 6, pm install-existing does not exist. This means every pm uninstall -k --user 0 on this phone is PERMANENT — the only way to restore the package is a factory reset.
This permanence is both the danger and the advantage. Dangerous because one wrong removal can brick the phone. Advantageous because the packages stay gone across reboots, unlike pm disable (which requires root and can be undone by system updates).
Packages were removed in 3 waves, rebooting between each wave to verify the phone still boots and functions. This conservative approach catches boot-loop-causing removals before too many packages are gone.
# Wave 1 — 12 packages (safe, obvious bloat)
adb shell pm uninstall -k --user 0 com.google.android.inputmethod.latin
adb shell pm uninstall -k --user 0 com.google.android.setupwizard
adb shell pm uninstall -k --user 0 com.android.calculator2
adb shell pm uninstall -k --user 0 com.android.dialer
adb shell pm uninstall -k --user 0 com.android.bluetooth
adb shell pm uninstall -k --user 0 com.android.email
adb shell pm uninstall -k --user 0 com.android.exchange2
adb shell pm uninstall -k --user 0 com.android.music
adb shell pm uninstall -k --user 0 com.android.calendar
adb shell pm uninstall -k --user 0 com.google.android.talk
adb shell pm uninstall -k --user 0 com.google.android.videos
adb shell pm uninstall -k --user 0 com.google.android.apps.plus# Wave 2 — 16 packages (telephony, media, downloads)
adb shell pm uninstall -k --user 0 com.android.providers.calendar
adb shell pm uninstall -k --user 0 com.android.browser
adb shell pm uninstall -k --user 0 com.android.gallery3d
adb shell pm uninstall -k --user 0 com.android.camera2
adb shell pm uninstall -k --user 0 com.android.stk
adb shell pm uninstall -k --user 0 com.google.android.apps.docs
adb shell pm uninstall -k --user 0 com.google.android.apps.maps
adb shell pm uninstall -k --user 0 com.google.android.apps.photos
adb shell pm uninstall -k --user 0 com.google.android.apps.books
adb shell pm uninstall -k --user 0 com.google.android.apps.magazines
adb shell pm uninstall -k --user 0 com.google.android.gm
adb shell pm uninstall -k --user 0 com.google.android.music
adb shell pm uninstall -k --user 0 com.google.android.youtube
adb shell pm uninstall -k --user 0 com.google.android.googlequicksearchbox
adb shell pm uninstall -k --user 0 com.motorola.help
adb shell pm uninstall -k --user 0 com.motorola.migrate# Wave 3 — 3 packages (final, more aggressive)
adb shell pm uninstall -k --user 0 com.android.chrome
adb shell pm uninstall -k --user 0 com.google.android.gsf
adb shell pm uninstall -k --user 0 com.google.android.location.fused# Count remaining enabled packages:
adb shell pm list packages -e | wc -l
# Expected: ~33 (down from 64+)
# Check total uninstalled:
adb shell pm list packages -u | wc -l
# Shows all packages including uninstalled — compare with -e count
# Verify the phone still boots:
adb reboot
# Wait for boot animation to finish, then:
adb shell getprop sys.boot_completed
# 1
# Check RAM freed:
adb shell cat /proc/meminfo | grep MemAvailable
# Should show ~100 MB more than before debloatcom.motorola.android.providers.settings. This causes a permanent boot loop. The phone gets stuck at the Motorola logo and the only fix is a factory reset via recovery mode (volume down + power)pm install-existing command. The only way to restore an uninstalled system package is a full factory reset, which wipes all datacom.google.android.gms (Google Play Services) and com.motorola.ccc.devicemanagement (Device Policy Manager). Both return "Failure" from pm uninstall. These require root to disable (see Hack #26)com.android.defcontainer (DefaultContainerService) breaks adb install. If you need to install APKs later, re-enable it first: adb shell pm enable com.android.defcontainer-k flag (keep data) does not help on Android 6 — the package cannot be reinstalled regardless. The flag is harmless but provides no safety net| Metric | Stock Android | After 31 Removals |
|---|---|---|
| Enabled packages | 64+ | ~33 |
| Background processes | 40+ | ~25 |
| Available RAM | ~180 MB | ~280 MB |
| RAM freed | N/A | ~100 MB |
| Reversible | N/A | No (factory reset only) |
| Resists removal | N/A | 2 (GMS, Device Policy) |