简体   繁体   中英

Android Emulator - permission denied when pulling files

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM