Uninstall multiple android packages using adb

Viewed 6174

I am trying to uninstall multiple packages using a bash script with adb uninstall.

In theory following scripts should work:

adb shell pm list packages com.your.app |
cut -d ':' -f 2 | while read line ; do
  adb uninstall --verbose $line
done

OR

adb shell pm list packages com.your.app |
cut -d ':' -f 2 |
xargs -L1 -t adb uninstall

I get the following error

Failure [DELETE_FAILED_INTERNAL_ERROR]

I also found that the problem is with adb commands not taking piped arguments or arguments from shell variables. For example the following command also

echo com.your.app | adb uninstall

This will also give the same error.

I have already looked at delete packages of domain by adb shell pm

1 Answers
Related