Skip to content

Instantly share code, notes, and snippets.

@timrijckaert
Created December 3, 2016 17:44
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 timrijckaert/291cb8cdeee49e7529e0fd160e86c1c7 to your computer and use it in GitHub Desktop.
Save timrijckaert/291cb8cdeee49e7529e0fd160e86c1c7 to your computer and use it in GitHub Desktop.
Pulls the default.realm file from a (rooted) device or emulator. Ideal for testing
#!/bin/sh
# Only works on rooted devices and emulators
packageName="${1:-be.vrt.mobile.android.deredactie.debug}"
realmNameOnDevice="${2:-default.realm}"
outputLocation="${3:-.}"
adb start-server
adb shell mkdir /sdcard/tempdata
adb shell "su -c 'cp data/data/$packageName/files/default.realm /sdcard/tempdata/$realmNameOnDevice'"
adb pull /sdcard/tempdata/default.realm $outputLocation
adb shell rm -r /sdcard/tempdata
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment