Last active
March 7, 2019 01:47
-
-
Save Shujito/94964b3b296cffa8676ee694237c7b2a to your computer and use it in GitHub Desktop.
uninstall android app from all connected devices and emulators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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