Skip to content

Instantly share code, notes, and snippets.

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 JeppeLeth/181b17bac228a33c6b86ceca40bac7a1 to your computer and use it in GitHub Desktop.
Save JeppeLeth/181b17bac228a33c6b86ceca40bac7a1 to your computer and use it in GitHub Desktop.
Uninstall all apps on an Android Device that have the intent-filter category IOT_LAUNCHER
#!/bin/bash
sp="/-\|"
sc=0
spin() {
printf "\b${sp:sc++:1}"
((sc==${#sp})) && sc=0
}
endspin() {
printf "\r"
}
echo "Uninstalling IOT_LAUNCHER category apps"
spin
userInstalledPackages=( $(adb shell pm list packages -3 | sed -e "s/^"package:"//" ) )
iotPackages=()
for userPackage in "${userInstalledPackages[@]}"
do
:
spin
categoryLauncherText=$( adb shell pm dump $userPackage | grep "android.intent.category.IOT_LAUNCHER")
if [ -n "${categoryLauncherText}" ]; then
iotPackages+=(${userPackage})
fi
done
endspin
for iotPackage in "${iotPackages[@]}"
do
:
echo "Uninstalling $iotPackage"
adb uninstall $iotPackage
done
echo "Complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment