Reputation: 1145
I have an Android 10 Emulator (API 29) with some RealmDB data files on it that I am trying to pull but I get a permission denied error, even as adb root.
Before when I was using an Android 9 emulator (API 28) I was able to pull the files onto my desktop as adb root by doing the following from cmd:
/C:/Users/Blah/AppData/Local/Android/Sdk/platform-tools> adb root
/C:/Users/Blah/AppData/Local/Android/Sdk/platform-tools> adb pull /data/data/com.myapp/ somewhere/on/my/desktop
and this worked fine.
But now I get this error - adb: error: failed to stat remote object '/data/data/com.myapp/': Permission denied
Upvotes: 1
Views: 2256
Reputation: 2119
Try executing this:
adb exec-out run-as com.myapp cp /data/data/com.myapp/databases/ /sdcard
Or
adb exec-out run-as com.myapp cp /data/data/com.myapp/files/ /sdcard
Then,
adb pull /sdcard
Your database should be in sdcard directory.
Note: It seems Android R emulator restricted /sdcard directory unfortunately. However, It should work for emulators with older Android versions. For instance, I tested through a Nexus 6P emulator and it worked properly.
Upvotes: 2