Created
December 22, 2016 03:36
-
-
Save do9iigane/79ef36cc8ec4b6b02585757a3ca7490c to your computer and use it in GitHub Desktop.
adb backup all packages by shell
This file contains hidden or 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
FILENAME="packages.txt" | |
adb shell pm list package > ./$FILENAME; | |
echo "packages list output to ./$FILENAME"; | |
cat ./$FILENAME | sed -e 's/package://g' | while read LINE;do | |
APKNAME=`echo ${LINE} | tr -d '\r'` | |
if [ ! -e $APKNAME.ab ]; then | |
echo "backup start : ${APKNAME}"; | |
adb backup -apk $APKNAME -shared -f $APKNAME.ab; | |
echo "backup complete : ${APKNAME} \n"; | |
else | |
echo "$APKNAME.ab is already backup. skip this line."; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment