Skip to content

Instantly share code, notes, and snippets.

@Shujito Shujito/adb-uninstall.sh
Last active Mar 7, 2019

Embed
What would you like to do?
uninstall android app from all connected devices and emulators
#/bin/sh
for DEVICE in $(adb devices | grep device$ | awk '{print $1}');
do
for APP in $(find . -maxdepth 3 -type f | grep build\.gradle | xargs cat | grep applicationId | awk '{print $2}');
do
RESULT=$(echo $APP | xargs -I _ adb -s $DEVICE uninstall _ 2>/dev/null);
if [ "$RESULT" == "Success" ]; then
echo "Uninstalled $APP from $DEVICE"
fi
done;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.