7

I want to see mt database file . That is why , I go to tools ->Android -> Android Device Monitor in Android studio . Then I have got the following picture :

enter image description here

But the data folder is empty . Why is the data folder empty ? How can I access my data base file ? Any advice is of great help .

osimer pothe
  • 2,827
  • 14
  • 54
  • 92
  • You got your ans? and you can use your data base file externally? – Ricky Patel Jan 04 '16 at 07:25
  • Possible duplicate of [Android Device Monitor "data" folder is empty](https://stackoverflow.com/questions/34603355/android-device-monitor-data-folder-is-empty) – Jämes Jun 30 '17 at 23:28

4 Answers4

7

It's not empty actually. It's the DDMS you are using that do not has proper permissions.

If you are using something like DDMS to access the /data folder of a device, you are actually accessing the folder with the Linux kernel user named shell who has a UID of 2000 and a GID of 2000.

However the /data folder of most Android devices is owned by the kernel user named system and the permissions of that folder is always described as drwxrwx--x which means all other users can't read/write the /data folder.

You can gain the access to that folder by switching to another user who has the permissions(system/root). Try using a emulator or rooting a device(not recommended).

Michael Zhou
  • 303
  • 1
  • 6
1

First your phone should be rooted, you can use https://www.kingoapp.com/ for that. Next, you should modify the permission of your app access, to do so you have to :

  1. Locate your adb.exe folder (you can find it in your sdk folders)

  2. Right click

  3. open cmd here

  4. Type:

    adb shell su chmod 777 /data /data/data /data/data/yourapp /data/data/yourapp/databases /data/data/yourapp/databases/*

Finaly, you can use your android device monitor to navigate into your database /data/data/yourapp/databases/*

Good luck

Mehdi Boukhechba
  • 2,471
  • 2
  • 19
  • 24
0

In Android studio version 3.0 or higher go to "View > Tool Windows > Device Files". The emulation must to be started.

Mr Schak
  • 21
  • 4
-1

Easiest way is using Android Device Monitor.

1) Run Android Device Monitor. How to run?; Go to [your_folder] > sdk >tools. You can see monitor.bat in that folder. shift + right click inside the folder and select "Open command window here". This action will launch command prompt. type monitor and Android Device Monitor will be launched.(There are other ways to open this too. Search it)

3) Select the emulator that you are currently running. Then Go to data>data>[your_app_package_name]>databases

4) Click on the icon (located at top right corner) (hover on the icon and you will see "pull a file from the device") and save anywhere you like.

Ronak Joshi
  • 1,553
  • 2
  • 20
  • 43