Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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