Skip to content

Instantly share code, notes, and snippets.

@alphacat2018
Last active December 12, 2016 12:14
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 alphacat2018/8d23586a4cfec5e0f0b19b6570025b4e to your computer and use it in GitHub Desktop.
Save alphacat2018/8d23586a4cfec5e0f0b19b6570025b4e to your computer and use it in GitHub Desktop.
Pull files and/or folders from an unrooted android device.There are two parameters when executing this batch:keyword of App's package name and keyword of filename for searching.
@echo off
adb shell "package=$(pm list package %1);packageName=${package#*package:};echo packageName: $packageName;filePath=$(run-as $packageName find /data/data/$packageName -name *%2*);echo filePath: $filePath;mkdir /sdcard/myPull;run-as $packageName cp -r $filePath /sdcard/myPull/;cd /sdcard/myPull;ls;"
adb pull /sdcard/myPull
adb shell "rm -r /sdcard/myPull"
pause
rem this line is an commented example: pullFiles MyApp .db.By this you can pull all db files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment