Tuesday, April 6, 2010

Debug Database with adb in Andoid

When I have created the sqlite database directly from my application. I am not getting where the database actually stored with application

Then I found that the system stores databases in the /data/data/package_name/databases folder by default.

To access that database We can use adb
Android Debug Bridge (adb) is a versatile tool lets you manage the state of an emulator instance or Android-powered device
  1. adb -s emulator-5554 shell
    adb -s <serialNumber> <command>
  2. sqlite3 /data/data/package_name/databases/database_name
Now you can access sqlite promt 
sqlite> .databases

which display 
seq  name             file                                                     
---  ---------------  ----------------------------------------------------------
1    main          data/data/package_name/databases/databasename

1 comment:

rathod said...

I am new in Android Development.
Please explain me how to connect database in android.
Thanks in Advance