Following are the steps to debug android application database using terminal and adb.
1. Open Terminal to start debugging your application database.
2. Goto your platform-tools folder under sdk.
3. Connect to device using adb
I use emulator in this tutorial. To connect to the device, type command “./adb -s <device-name> shell”. You’ll be redirected to the root folder of your device.
4. Navigate to your database folder.
go to the folder where your database located. The location is in “data/data/<package-name>/databases/”
5. Call sqlite3
execute “sqlite3 <database-name>” to launch sqlite3 service
6. Start playing with your database
You will be able to issue command to your database using sqlite3. One thing to be noted is that the foreign key restriction is not activated here, so that you are able to add any row to any table.