Android ADB (Android Debug Bridge) View and pull cache files of an app

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!


You may use this command for listing the files for your own debuggable apk:

adb shell run-as <> ls /data/data/

And this script for pulling from cache, this copy the content to sdcard first, pull and then remove it at the end:

adb shell "run-as <> cat '/data/data/<>/$1' > '/sdcard/$1'"
adb pull "/sdcard/$1"
adb shell "rm '/sdcard/$1'"

Then you can pull a file from cache like this:

./ cache/someCachedData.txt

Get Database file via ADB

sudo adb -d shell "run-as cat /data/da/ /databases/STUDENT_DATABASE  > /sdcard/file

Got any Android Question?