Skip to content

Instantly share code, notes, and snippets.

@damien5314
Created July 12, 2017 06:41
Show Gist options
  • Select an option

  • Save damien5314/22f6c47ac2261aa8bd344a21caa04e71 to your computer and use it in GitHub Desktop.

Select an option

Save damien5314/22f6c47ac2261aa8bd344a21caa04e71 to your computer and use it in GitHub Desktop.
Creates an app backup using the standard Android mechanism, then pulls backed up data to a connected machine.
#! /bin/bash
path=build/data
mkdir -p $path
adb backup -f $path/appdata.ab -noapk com.example.app
( cd $path && dd if=appdata.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf - )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment