Working with SQLite databases through command Line in android.

By | January 23, 2012

Hello all,
In todays tutorial I will show you how to work with sqlite databases in android through command line.

1. You can browse any number of databases.
2. You can write any queries and execute.

First go through these tutorials to get a glance of how to work with sqlite databases in android.

After going through these tutorials you will get to know these.
1. How to create an SQLite database.?
2. Where to locate the database file in your device or emulator?
3. How to browse the database using the plugin I provided in this example(

I am using the sqlite database that I created using this example

Now open the command prompt or terminal and type

adb -s emulator-5554 shell

now type the path of your sqlite database like this.

sqlite3 /data/data/com.coderzheaven.pack/databases/mytest.db

check the screenshot for example

Now look at the screenshot for how am I navigating through the tables and selecting and inserting values to the table creating new tables etc.
Click and enlarge the image to see it.

You can exit the shell by typing ‘ ctrl+d’ twice.

This is the path of my database file

Which you can see by opening the file explorer from the window menu and expanding your package folder.(check this example for a screenshot of how to see the database

Now about the SQLite database file.
Here I have three tables my_table, temp_table and test_table.
I am executing different commands to manipulate these tables.
The results are appearing just after the command

Please leave your valuable comments on this post.
Also +1 this post to share it to others if you liked it.

2 thoughts on “Working with SQLite databases through command Line in android.

  1. razor

    I’ve installed plugin (eclipse4) but database icon is disabled.
    I can’t enter /data folder too
    i’m using Samsung Galaxy Nexus (android 4.2)


Leave a Reply

Your email address will not be published.