- Make sure that USB debugging is enabled.
- Deactivate all bloatware apps.
- List the names of all deactivated packages:
$ adb shell pm list packages -d
I redirected this into a file and filtered google packages and removed the prefixc:
$ adb shell pm list packages -d | grep -v 'com.google' | sed -e 's/^package://' > /tmp/deactivated-packages
- Uninstall the packages
# either one-by-one
$ adb shell pm uninstall -k --user 0 <package-name>
# or use the list
$ for p in $(cat /tmp/deactivated-packages); do adb shell pm uninstall -k --user 0 "$p"; done
Voila!
Sources: