0

I have an application on Android, which uses database (SQLite). And I want to see tables and values in this database. I use Eclipse and I have ADT installed. So I can easily run my apps on emulator. Anyway, it would be great to have some tool or a program? How can I actually see what is in db files? And how to find them? Thanks.

asked Sep 14, 2011 at 19:42
2

2 Answers 2

1

One way is by opening a shell to the emulator and then working with your database through the built in sqlite3 tool.

Example: Assume your app name is "com.example.myapp" and your database name is "mydb"

>adb -e shell
>cd data/data/com.example.myapp/databases
>sqlite3 mydb

at this point you should have a shell to work with your db.

Some useful commands:

.dump
.help
.schema
.exit

If you have a table called "my_table", you can use the select syntax to query.

select * from my_table;

Also, here's a link with more infO: http://developer.android.com/guide/developing/tools/adb.html#sqlite

answered Sep 15, 2011 at 0:03
Sign up to request clarification or add additional context in comments.

Comments

1

If you're in the emulator, you can use adb pull command at a command prompt and then load the sqlite file in a sqlite viewer. I've used one that is a Firefox plugin and it worked great.

http://developer.android.com/guide/developing/tools/adb.html#copyfiles

https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/

Note that this doesn't work when you deploy to an actual device...

adb pull only works with the emulator. You can get right to the db files on a rooted device as well.

The actualy db file will be a .sqlite file at the following location on the emulator:

data> data> your-package-name> databases> your-database-file.

ann
5721 gold badge10 silver badges19 bronze badges
answered Sep 14, 2011 at 19:46

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.