While creating android application you might encounter a situation where you works with the Sqlite Database for storing data in an android device. This database is very helpful in storing the data on the users mobile phone itself. But as a programmer it become difficult for you to test the database. So you can use adb shell to view the contents of table inside your database. You need to perform these steps in order to achieve that:
open your sdk folder.
Mines is located at
D:/android/sdk
now open platform-tools
D:/android/sdk/platform-tools
There may be many devices connected to you pc or different emulator running, in order to
view the no. of device connected type the following command
adb devices
Now connect the shell to the device
adb -s emulator-xxxx shell
You database is located inside databases folder which is present inside your package
cd data/data/package-name/databases/
now run sqlite3 command in order to use your database
sqlite3 database-name.db
Now you can control run queries like SQL
Leave a Reply