Restoring an app you uninstalled
· 2 min read
You removed something and want it back. In the overwhelming majority of cases that is one command.
The command
adb shell cmd package install-existing com.example.package
Expected reply:
Package com.example.package installed for user: 0
It works because the application was never fully deleted. Uninstalling with
--user 0 only withdrew it from your user; the factory file is still on the
system partition. install-existing links it back.
If the command fails
Package ... new package not known
Can happen on older Android versions. Try the alternative form:
adb shell pm install-existing com.example.package
And failing that:
adb shell pm enable com.example.package
Still not back
Then the safe route: factory reset. It reinstates absolutely all the original software. You lose settings and any accounts you added, but the television comes back exactly as it left the box.
It is under Settings → Device preferences → Reset. Tedious, and it is the guarantee that none of this is irreversible.
Recovering several at once
If you got carried away, you can reinstate everything missing for your user:
adb shell cmd package list packages -u
That -u includes uninstalled ones. Compare against the list you saved before
starting — if you saved it, and this is why we keep going on about it — and work
back through.
Why this matters more than it looks
Reversibility is not a technical detail, it is the criterion by which we decide what to publish. A directory entry does not go live until somebody has run the restore command on that exact model and confirmed the application comes back.
It sounds excessive. It is not: the difference between "this can be undone" and "this ought to be undoable" is the difference between useful advice and a problem.