Skip to content

Instantly share code, notes, and snippets.

@j796160836
Forked from davidnunez/gist:1404789
Last active June 16, 2019 17:27
Show Gist options
  • Save j796160836/2489a33c370ab849a461 to your computer and use it in GitHub Desktop.
Save j796160836/2489a33c370ab849a461 to your computer and use it in GitHub Desktop.
Get installed packages and convert into command format (Just copy & paste to uninstall whatever packages.)
#!/bin/bash
DEVICE=$1
if [ -z $DEVICE ]; then
DEVICE=`adb devices | sed '/List of devices/d' | head -n 1 | awk '{print $1}'`
fi
if [ -z "$DEVICE" -o "$str" == " " ]; then
echo "Please connect a device."
exit 1
fi
adb -s $DEVICE shell 'pm list packages -f -3' | sed -e 's/.*=//' | sed -e "s/^/adb -s $DEVICE uninstall /" | sort | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment