Hi I have this script to debloat my phone:
#!/bin/bash
adb devices
sleep 1
cat packagelist.txt | while read line
do
echo removing $line
adb shell pm uninstall --user 0 $line
done
and packagelist.txt is something like
com.miui.miwallpaper
com.miui.cloudservice
com.miui.notes
with the new line at the end.
If I comment the line with adb shell etc..
it kindly prints all the lines of the file as should be but otherwise it only excecutes the command with the first package and then exits. The first package is already uninstalled so it gives an error but I'd like to ignore them and continue the loop. I tried also without the loop hardcoding the package name in adb shell etc...
and this continues even if the first gives an error.