2

I'm developing an Android application and using SQLite.

I would like to access the database and run some SQL queries on the emulator handset for debugging purpose. How to do this?

1 Answer 1

4

You can use the sqlite3 command. Read here http://developer.android.com/guide/developing/tools/adb.html#shellcommands

To use sqlite3, enter a remote shell on the emulator instance, as described above, then invoke the tool using the sqlite3 command. Optionally, when invoking sqlite3 you can specify the full path to the database you want to explore. Emulator/device instances store SQLite3 databases in the folder /data/data//databases/.

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
.... enter commands, then quit...
sqlite> .exit 
Sign up to request clarification or add additional context in comments.

1 Comment

there's also motodev plug-in which incorporates DB tools into Eclipse

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.