I recently created an Emulator device with Android Studio,but only to find that I can't open the /data/data folder to get the sqlite db file.The folder just can't open,I have tried to use shell scirpt to chmod the /data directory,but it says the su command not found.
The Emulator
Can't open!
Is there anyone has the same problem? Or I have to root the Emulator? But it's an Emulator! I just think it's kind of inconvenient to root a Emulator!
In Android N emulator you can easily get access Internal Memory. Then a pop up will open. Click on explore . Then you will get access of Internal Storage.
Update
Can't remember whether it's from Android Studio 3.0 or later but if you have downloaded AS 3.3+, you'll find the tab on bottom right corner called Device File Explorer
, which lets you to see and easily get the data of your app without rooting.
Opening as Administrator didn't help but rooting the phone did worked, and no I'm not lowering my SDK version.
Open cmd and go to C:\Users\{User}\AppData\Local\Android\Sdk\platform-tools or to the folder location and type cmd
at the address bar.
Whether you're super user or not can be determined by $
:
C:\{User}\...\platform-tools>adb shell
generic_x86:/ $ exit
To have su/root privileges type adb root
and exit:
C:\{User}\...\platform-tools>adb root
generic_x86:/ # exit
Next run the Android Device Monitor to extract the data.
To turn off root type adb unroot
.
Even after running Android Studio as administrator if you can't access data/data folder, try using API 23 or lower for you emulator device.
Using Android Studio 3.1.2 and DDMS is no longer available under the Tool options. Instead Android Studio has the "Device File Explorer" tab available on the bottom right (I know why put it there).
Click on the "Device File Explorer" tab and select the Android Device you want to explore. To actually access the files, make sure USB Debugging is turned on in the AVD.
If that doesn't work, you'll need to use Terminal panel.
C:\Users\B\AppData\Local\Android\sdk\platform-tools> adb pull /data/data/com.example.b.expensewatcher/databases/myexpenses.db
/data/data/com.example.b.expensewatcher/databases/myexpenses.db: 1 file pulled. 3.3 MB/s (24576 bytes in 0.007s)
For more details on changing folder permissions see: https://www.dev2qa.com/android-device-monitor-cannot-open-data-folder-resolve-method/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With