0

I'm trying to convert my app to be compatible with API 25 (Nougat). But when I try to use adb shell to go to my app's databases folder inside the virtual device, it wouldn't let me. It says Permission denied.

I tried

adb shell
cd data/data/<my app's name>/databases

I use the same procedure on API 23 virtual device and it works.

Also, are all nougats not rooted, even in emulators? I'm using Android Studio 2.2.3 and I created the virtual device using the its built-in AVD.

F0r3v3r-A-N00b
  • 2,903
  • 4
  • 26
  • 36

2 Answers2

2

So i find this to be working:

adb root shell
adb shell

Then I'm able to navigate to my app's database folder and open it.

F0r3v3r-A-N00b
  • 2,903
  • 4
  • 26
  • 36
  • When creating and emulator you have to select a system image that does not has Google API, like Intel x86 image, as the Image containing Google API is a production build and you would not get access to root folders, however if you are using the other Images that I mentioned along with the "adb root shell" command you would be able to access the databases in the application folder – Saravana Kumar K R Apr 26 '20 at 04:45
0

You must run ADB in root mode to get access to database folder.

Check this link - Why do I get access denied to data folder when using adb?

EDIT

Here is what I found---

You were already in the root mode in API 23 and that is why you were able to access the database there but for API 25 you were not.

For API 23

G:\android_studio_new\sdk\platform-tools>adb shell

root@generic_x86:/ #

For API 25(Nougat)

G:\android_studio_new\sdk\platform-tools>adb shell

generic_x86:/ $

Community
  • 1
  • 1
ray an
  • 1,132
  • 3
  • 17
  • 42
  • All API 25 (Nougat) virtual devices that I create are not rooted. I don't know how to create a rooted virtual device by default in API 25. However all API 23 and below virtual devices that I create have root access. And I have no problem opening my SQLite databases when I'm using API 23. – F0r3v3r-A-N00b Apr 23 '17 at 07:38
  • Let me myself check if could open database in API 25 devices – ray an Apr 23 '17 at 07:42
  • Could you please accept or upvote my answer(if you are satisfied). Thank you. – ray an Apr 23 '17 at 10:34