Skip to content

Instantly share code, notes, and snippets.

@meoyawn
Created July 27, 2015 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meoyawn/426eae6dcd28d66f6d7d to your computer and use it in GitHub Desktop.
Save meoyawn/426eae6dcd28d66f6d7d to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
appId=$1
dst=/sdcard/container-${appId}
tar=/sdcard/container-${appId}.tar.gz
backup_file=${appId}.ab
rm -f $backup_file
adb backup -f $backup_file $appId &
sleep 1
adb shell input keyevent 22
adb shell input keyevent 23
while [ ! -f $backup_file ]
do
sleep 1
done
rm -rf apps
dd if=$backup_file bs=24 skip=1 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf -
rm -f $backup_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment