SQLite database tool
From a remote shell to your device or from your host machine, you can use the sqlite3 command-line program to manage SQLite databases created by Android applications. The sqlite3 tool includes many useful commands, such as .dump to print out the contents of a table and .schema to print the SQL CREATE statement for an existing table. The tool also gives you the ability to execute SQLite commands on the fly.
To use sqlite3 from a remote shell:
- Enter a remote shell by entering the following command:
adb [-d|-e|-s {}] shell
- From a remote shell, start the sqlite3 tool by entering the following command:
sqlite3
You can also optionally specify a full path to a database that you want to explore. Emulator/device instances store SQLite3 databases in the directory /data/data/
/databases/.
- Once you invoke sqlite3, you can issue sqlite3 commands in the shell. To exit and return to the adb remote shell, enter exit or press Control+D.
Here's an example:
$ adb -s emulator-5554 shell # sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db SQLite version 3.3.12 Enter ".help" for instructions # sqlite> .exit
To use sqlite3 locally, instead of within a shell, pull the database file from the device and start sqlite3:
- Copy a database file from your device to your host machine:
adb pull
- Start the sqlite3 tool from the /tools directory, specifying the database file:
This site uses cookies to store your preferences for site-specific language and display options.
You have successfully signed up for the latest Android developer news and tips.
You requested a page in , but your language preference for this site is .
Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.
This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.