Search code examples
androidadb

How to pull a file through ADB?


Actually in my application after an intent is sent I create a file called myfile.asc now i'm trying through ADB to pull that file but the issue is that by using

adb pull /data/data/xx.xxx.xxx/files/myfile.asc

or

adb pull /data/data/xx.xxx.xxx/files/myfile.asc C:\Users\me\Desktop\files

it returns

"remote object does not exist"

The path is actually taken from the Android Studio device File Explorer by clicking on the file and copying the path.


Solution

  • You are trying to access the private folder file which is not accessible in non-rooted android device. For that you need to get the adb shell access then provide the permission to access that directory.

    For this use case, I have created a library that can help you. It's open-sourced.

    https://medium.com/@mohom.r/extracting-android-data-files-of-our-android-app-from-non-rooted-device-be9084ddbdc3