I have tested creating, inserting and retrieving data into my apps db, and know it works through usage of Log statements.
However, I wish to expedite testing and us
If anyone is having the stated problem, follow below steps in terminal window:
That's it. Problem solved.
I had same problem with API_25
, it didn't work for me.
Configure an API_23 emulator
, it will work on API_23
.
In cmd GoTo:
C:\Users\UserName\android-sdks\platform-tools
Execute:
adb root
Done
It may be easier to store the database in a public folder during development.
Or you can see this post :
How to access data/data folder in Android device?
The folder /data
can be empty because you are missing the proper permissions. To solve it, I had to execute the following commands.
adb shell
su
Those commands starts a shell in the emulator and grant you root rights. The command adb
is located in the folder platform-tools
of the Android SDK, typically installed in ~/Library/Android/sdk/
on MacOS.
chmod -R 777 /data
Modify the permissions of the folder (and subfolders recursively) /data
in order to make them appear in the tool Android Device Monitor.
adb root
Finally, this command restarts adb
as root. Be careful, it only works on development builds (typically emulators builds).
Afterwards, you can see the content of the folder /data
and transfer the data located in. You can do it in console as well, using adb pull <remote> <locale>
, such as:
adb pull /data/data/<app name>/databases/<database> .
There are two ways if you want to browse your device data (data/data) folder.
ADM location - (YOUR_SDK_PATH\Android\sdk\tools)
adb root
If you just want to see your DB & Tables then the esiest way is to use Stetho
. Pretty cool tool for every Android developer who uses SQLite
buit by Facobook developed
.
Steps to use the tool
'compile 'com.facebook.stetho:stetho:1.4.2'
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Stetho.initializeWithDefaults(this); setContentView(R.layout.activity_main); }
Now, build your application & When the app is running, you can browse your app database, by opening chrome in the url:
chrome://inspect/#devices
Screenshots of the same are as below_
ChromeInspact
Your DB
Hope this will help all! :)