Make a script like this:
#!/bin/bash
sh -c "$1 $2 $3 $4 $5 $6 $7"
if [ $? != "0" ]; then
printf "Clearing data failed! Running anyway..."
fi
exit 0
Make an "external tool":
- Program:
- the above script
- Args:
- adb -s SERIAL shell pm clear PACKAGE
- e.g. adb -s emulator-5558 shell pm clear edu.rutgers.css.Rutgers.alpha
- adb -s SERIAL shell pm clear PACKAGE