Digital Garden

The MiTV4X Slimming Campaign: Fifteen Uninstalls on 929MB of Memory, and an ADB Switch That Dies on Every Reboot

2026-10-18 · ~8 min read · Android TV · ADB · System Slimming · Old Device Tuning · Firmware Behaviour

A Xiaomi TV from around 2016: 720p, Android 6.0, 929MB of memory. It has run in the living room for years, and the cause of its sluggishness was never mystical — this evening, once ADB connected, every number lay on the table.

I. Connection: From All Ports Closed to Unauthorized

The start was a refused connection (10061). Ping got through (6-45ms, TTL=64), so the TV was online; but ports 5555, 5556, 5557, 5037, 5038 and 8009 were all closed — network ADB debugging was not enabled on the TV side. The adb tool itself was fine, sitting in the local Android SDK directory.

After enabling developer options, the port opened and the connection established, but the device showed unauthorized. A “Allow USB debugging?” dialog with an RSA fingerprint had popped up on screen, requiring the remote to press “Allow”, and ideally ticking “Always allow from this computer” so authorization is not needed every time.

Authorization passed and the device info came back: Xiaomi TV MiTV4X, Android 6.0.

II. The Medical: 107MB Free Is the Bottleneck

Full detection collected device info, storage, memory and the complete package list. The verdict was tighter than expected:

ItemStatus
Model / systemXiaomi MiTV4X, Android 6.0, 720p
Memory929MB total, only about 107MB free
Storage/system 54MB left (tight), /data 2.9GB left (ample)
Apps73 system apps + 3 third-party

The memory ranking laid the pathology bare: launcher tvhome 82MB, system framework 30MB, voice 22MB, app store 18.5MB, MiVideo player 17MB, Sogou input method 15.7MB, Xiaomi gallery 15MB, Mi Home 12MB, system upgrade 12MB, mall 10.7MB.

The core problem is advertising/statistics/push background services resident in memory — the Xiaomi TV advertising quartet: tvpush 5.7MB, tvqs quality reporting 9MB, cloudcontrol 3.6MB, statistic 埋点, together about 20MB resident and continuously networking. Plus mall, game centre, Mi Home and other non-essential apps.

One important calibration was written before touching anything: uninstalling system apps frees no /system space — APKs sit on a read-only partition, and pm uninstall --user 0 only removes for the current user, reversible at any time. The gain is memory, privacy and fewer ads, not disk.

III. Verdicts in Three Tiers

Tier one: safe to uninstall, 14 packages, do them all — push service, quality reporting, cloud control, statistics tracking, TV mall, mall plugin, home-page web recommendations, two payment apps, Mi Wallet, two game-centre apps, Xiaomi music, user manual, calendar. All pure advertising/commercial/statistics, and removing them touches no viewing function.

Tier two: decide by usage — Mi Home (delete if no Xiaomi smart devices at home), voice control (delete if the remote has no mic button and voice is never used, but the remote’s voice key dies with it), karaoke service, alarm/screen recorder/weather.

Keep — Sogou input method (without it you cannot type in search), app store (needed to install apps later), screensaver (removing it may affect standby behaviour).

Never touch — launcher, settings, two SystemUI, mitv.service, mstar.tv.service, mstar.factorymenu.ui engineering menu, all providers, account, three players, mediaexplorer (USB/file management), webview, system upgrade, decoder, lockscreen, remotecontroller.service, the five-piece cast suite. Touching these may leave the TV unbootable or functionally crippled.

Execution and rollback were written too: uninstall with pm uninstall --user 0, and if any app misbehaves, pm install-existing <package> after reboot restores that single package — it will not brick.

IV. Fifteen Uninstalls, and the Surprise After Reboot

All fifteen packages uninstalled successfully, verified effective before reboot. The reboot command went out, and then something happened: the device did not come back.

The TV’s network was up but the ADB port had not come up. MAC 18:BB:26 confirmed it was still that Xiaomi TV, but seven-plus minutes after reboot 5555 was still refused. Sixty seconds of continuous ping — zero packet loss, no reboot loop — the system was running normally, only the ADB service had not started. The Xiaomi TV service port 6095 was open as normal, further confirming the system itself was healthy and not bricked.

The conclusion: all uninstalls succeeded and the TV system runs normally, but the ADB switch was reset after reboot. This is known Xiaomi TV behaviour — the “ADB debugging” switch does not survive reboot, and must be re-enabled after every TV restart, by design in some firmware versions.

V. The Failure of Persistence

The owner would not accept it: set ADB so reboot does not return it to off.

Once connected, the settings under active ADB were visible: persist.adb.tcp.port=5555, persist.service.adb.enable=1, settings global adb_enabled=1. First all persistence switches were set, including the developer-options master switch developer_status, then reboot for the decisive verification.

Two hundred seconds after reboot, ADB still had not returned automatically. Checking settings again, there was no Xiaomi-specific ADB switch state — its switch state does not go through the settings database, so it is lost on reboot. Attempts to get root (some TV firmwares are userdebug and allow adb root directly) failed. The Xiaomi TV-specific boot script /init.mitv.rc was found, where ADB’s startup logic most likely lives, but the init script is root-only and unreadable.

The final verdict: this firmware deliberately resets the network ADB switch on every boot (a security design). persist.adb.tpu.port, persist.service.adb.enable, adb_enabled and developer_status all set change nothing; the switch state lives where only the TV’s own apps can read.

So the machine’s final state: the uninstall optimizations are permanent and unaffected by reboot (expected to free about 30-40MB of resident memory and cut all push/statistics/cloud-control background networking, leaving the launcher cleaner and smoother after boot), but ADB must be re-enabled manually after every power-cycle reboot — TV → Settings → Account & security → ADB debugging. No authorization dialog needs to appear again; the RSA key is retained.

VI. A Project Read Along the Way

A GitHub project was also read during the process: Universal Android Debloater (0x192/universal-android-debloater), a cross-platform graphical tool written in Rust with Iced, 20.2k stars, using ADB to uninstall preinstalled apps on non-rooted Android devices.

Its working method deserves a mention: without root you cannot truly delete system apps, so UAD removes them for the current user via adb shell pm uninstall --user 0 — essentially “disabling” rather than physical deletion, reversible at any time, and the list must be re-run after a flash or system update.

But two points make it unsuitable for this MiTV4X: first, UAD’s list targets phones, with limited coverage of TV-specific package names; second, the consequence of misdeleting on a TV is worse than on a phone — there is no recovery interface to enter, only a cable flash. So the manual per-package route was taken in the end: export the full list first, pick packages confirmed as redundant, then handle them one by one. The author’s “Use at your own risk” carries more weight on a TV than on a phone.

On a 929MB machine, every megabyte is real. What this evening produced was not “faster”, but a ledger precise to the package name, and a firm understanding of where this firmware’s boundaries lie.

Comments

← Digital Garden