Skip to content

Instantly share code, notes, and snippets.

@Jipok
Last active March 2, 2021 14:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Jipok/a9467ff249008918b5219acba1d3b958 to your computer and use it in GitHub Desktop.
Save Jipok/a9467ff249008918b5219acba1d3b958 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euo pipefail
UNISTALL_CMD="echo -n {} '- '; adb shell pm uninstall --user 0 {}"
while true; do
pkgs=$(adb shell 'pm list packages -f')
names=$(echo "$pkgs" | grep -Po '[^=]*$')
paths=$(echo "$pkgs" | grep -Po '(?<=:)(.+?)(?!.*=)' | sed 's/.\{1\}$//')
paste <(echo "$names") <(echo "$paths") | column -t | fzf -m -i -n1 -d' ' | \
cut -f1 -d' ' | xargs -r -I{} sh -c "$UNISTALL_CMD"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment