I created this gist to make remembering codes easier because of my ever increasing use for things like this.
Phone space is at an ever increasing premium for older phones.
adb shell
$ pm list packages | grep -i $package_name // The -i makes the search case-insensitive
$ pm list packages | grep -i google
package:com.google.android.apps.classroom
package:com.google.android.overlay.gmsconfig
package:com.google.android.apps.docs
package:com.google.android.apps.maps
package:com.google.android.modulemetadata
$ pm list users // Look and take note at the id number
$ pm list users
Users:
UserInfo{0:user_A:10} running
UserInfo{95:DUAL_APP:52145672} running
UserInfo{150:Secure Folder:74221230} running
$ pm uninstall -k --user $user_id $full_package_name
/* -k means you delete the package but keeps the user data (for reinstalling purposes).
If you don't want to keep the user data, don't use -k. On the other hand,
there is another command if you only wanted to delete the data without removing the package.
You'll probably want to use 'pm clear $full_package_name'.
IMPORTANT NOTE:
DO NOT, I REPEAT, DO NOT EVER UNINSTALL AN APP IF YOU AREN'T SURE THAT IT'S
SAFE TO BE UNINSTALLED. THINGS INCLUDE, BUT NOT LIMITED TO: Google Play Store, Samsung Store,
and anything that has a shortcut inside the Settings app. */
$ pm uninstall -k --user 10 com.google.android.apps.classroom
Success
$ pm uninstall -k --user 150 com.google.android.apps.classroom
Success
/* Remember that if you have multiple users (especially if you use Secure Folder in Samsung),
you WILL probably have multiple apps. Yeah, I'm looking at you, multiple Chromes and Slides. */