Maybe the title isn't very clear. Here is what I mean/need to know-
If I use SQLite for some data storing purpose on Android app, I can see the DB created in my phone. (/root/data or something I guess). I have viewed the DB and performed some manipulations, it helps in development.
Now, I am using AsyncStorage API of react native. There is some problem in my code, I am not able to get the stored data from the store. Not sure what I am doing wrong.
So, to see what's wrong, is there a way to view the list of Objects that are being stored on the phone? If so where? And how do I view it?
PS: I am debugging my React Native app using Android Studio's logs. As my chrome on linux is a bad boy(Any Help would be appreciated)!
You can follow below steps
Run your apk in debug mode in your device and connect your device to your system
Open command prompt.
To get list of databases related to your application use below command
adb -d shell "run-as om.yourpackage_name ls /data/data/com.yourpackage_name/databases/
you can get package name from your AndroidManifest.xml file
adb -d shell "run-as com.yourpackage cp /data/data/com.your_package/databases/RKStorage /sdcard/Rkstorage"
adb pull /sdcard/Rkstorage
Now Install Firefox SQLite Manager: https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/
Open Firefox SQLite Manager from Tools->SQLite Manager
In SQLite Manager go to Database->Connect Database and "open file" window will open there you select All files at bottom of your window and navigate where your database copied.
Thanks.
React Native on Android actually uses SQLite to back up the AsyncStorage API. The database file is /data/data/<your_app>/databases/RKStorage
on your device/emulator. Keys and values are stored in a table named catalystLocalStorage
.
Use sqlite3 /data/data/<your_app>/databases/RKStorage .dump
to see entire content. And use cp /data/data/<your_app>/databases/RKStorage /mnt/sdcard/
and use adb pull/push
to copy it to your local device.
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