Use adb pull to copy app file from phone (not rooted)

I am using a MacBook as my development machine. My Android phone is not rooted. I want to copy an Android application file from my phone to my MacBook. I tried the following:

  • Connect Android phone to MacBook (developer option included)

  • adb pull /data/data/com.my.app/app_data/data ~/Documents/my/app/

where /data/data/com.my.app/app_data/data

is the path to the file on the phone and ~/Documents/my/app/

is the path to the directory on the MacBook.

But the above command adb pull

shows Permission denied .

I also tried using su

pod adb shell

, but it doesn't work either:

~$ adb shell
shell@xyz:/ $ su
/system/bin/sh: su: not found

      

So how can I copy the internal application file to the MacBook folder?

+3


source to share


2 answers


On an unmanaged phone, you cannot access the app's personal data directory ( /data/data/com.my.app

).

The only way to retrieve the data is to back up the app data with adb backupp

:

adb backup -f mybackup.ab com.my.app



You can use Android Backup Extractor to extract information from the created backup archive . It converts android backup archive to tar archive file.

Note. If the application indicates in it that the backup is prohibited, the described method does not work. In this case, the only way is to use the phone.

+1


source


You need to navigate to the file with adb shell

.

Then copy to sdcard:

cat yourfile > /sdcard/yourfile



Then exit the adb shell and you can now pull:

adb pull /sdcard/yourfile

0


source







All Articles