Recently, I bought a brand new Sony Xperia mainly because of its 24-bit DAC so I could listen to my HiRes FLAC files. It was the cheapest non-chinese vendor with dual SIM support that supports HiRes audio (wired/wireless).
Not a novel solution but more elegant!
The problem started as I noted that my phone has Netflix and Facebook pre-installed but there is no way to remove them using the standard Android GUI. A quick search led me to this post by xda developers which solved my problem. In short the solution is fairly straightforward:
- Install ADB and enable USB debugging
- Connect to your device through ADB shell
- Search for package names that you want to remove
pm uninstallto remove packages one by one
I thought to myself “well if we are using a simple shell, we could put the last two steps together and get rid of copy/pasting”. So this is the result:
pm list packages | grep facebook | sed 's/package://' | xargs -n 1 pm uninstall --user 0
pmstands for package manager and is used here to
listall installed packages and consequently
grepis used to filter only desired packages (here
sedis to cleanup results.
package:string as prefix for each package name.
xargstakes the results from previous commands and apply them as arguments to the given command (here
pm uninstall --user 0). Note the usage of
-n 1that tells
pm uninstallfor each line of result not once for all results.
One last note: later, I found out that someone had already proposed a similar solution but using
td instead of