Skip to content

Instantly share code, notes, and snippets.

@cezarypiatek
Last active August 17, 2023 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cezarypiatek/f6443e28bfe034c86874ee6698e66e2b to your computer and use it in GitHub Desktop.
Save cezarypiatek/f6443e28bfe034c86874ee6698e66e2b to your computer and use it in GitHub Desktop.
Debloat andoid
# Disable apps
adb.exe shell 'pm list packages -f' |% {$($_ -split "=") | Select-Object -Last 1} | ogv -OutputMode Multiple |% {adb shell pm disable-user --user 0 $_}
# Enable aps
adb.exe shell 'pm list packages -f' |% {$($_ -split "=") | Select-Object -Last 1} | ogv -OutputMode Multiple |% {adb shell pm enable $_}
# Uninstall apps
adb.exe shell 'pm list packages -f' |% {$($_ -split "=") | Select-Object -Last 1} | ogv -OutputMode Multiple |% {adb shell pm uninstall -k --user 0 $_}
adb.exe shell 'pm list packages -d -f' |% {$d =$($_ -split "="); [pscustomobject]@{name=$($d[0] -split "/")|Select-Object -Last 1; id= $d |Select-Object -Last 1}} | ogv -OutputMode Multiple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment