How to pull/read Android App 's database

Outline

  • Pull 
  • Change Permission 
  • Read
  • Problems and Solutions

The program to read SQLite Database Download
To Pull
open cmd
then 
move to adb 's directory then run adb as root then pull
for example

D:
cd D:\Android\android-sdks\platform-tools
adb root

adb pull /data/data/com.example.umitems/databases/umitems.db .

note that   adb pull <source> <destination>

Change File permission and pull

adb shell "run-as package.name chmod 666 /data/data/package.name/databases/file"

adb pull /data/data/package.name/databases/file .



adb shell "run-as package.name chmod 600 /data/data/package.name/databases/file"

To Read
open cmd
then 
move to adb 's directory 
then run adb as root 
then move to your apps's directory
then use command sqlite3
D:
cd D:\Android\android-sdks\platform-tools
adb shell
su
cd /data/data/com.example.umitems/databases
ls
sqlite3 HealthAdvisor.db 

This is some useful command.
.help List all commands and options.
.exit Exit the sqlite3 command.
.schema Show the CREATE statements which were used to create the tables of the current database.
.table show tables.


The problems you may found and solutions

Error: Device not found
Try command adb devices
Try to unplug and plug it back
Try to reboot your device
Try to check to driver compatible

Error: Access denied
Need to root your phone
Check in Setting/Developer then grate root access to adb

Android Debug Monitor (DDMS)
DDMS cannot access data/data
DDMS cannot access database

If you have any questions or suggestion please leave the comment below ^^ .

ref.
http://stackoverflow.com/questions/7441248/android-adb-returns-the-device-not-found-error
http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html
http://stackoverflow.com/questions/11128559/android-adb-with-pull-command
http://stackoverflow.com/questions/18471780/android-adb-retrieve-database-using-run-as
http://stackoverflow.com/questions/6928849/debugging-sqlite-database-on-the-device
http://stackoverflow.com/questions/9997976/android-pulling-sqlite-database-android-device
http://stackoverflow.com/questions/2078710/android-adb-access-to-application-databases-without-root
http://stackoverflow.com/questions/13006315/how-to-access-data-data-folder-in-android-device

Popular posts from this blog

เทคนิค ชนะ เกมเศรษฐี 14 ตารวด!!! ( Let's get Rich )

Using Google Chrome Inspect Element to Analyze the website

Easy way to download whole youtube play list and convert them to mp3