Marcos Vasconcelos
Marcos Vasconcelos

Reputation: 18276

Access a terminal to execute Queries from Android

How can I query my SQLite database of my application from a terminal?

I need it to debug purposes, and also to check values.

I tried from the Emulator Command Line, I moved to the /data/data//databases folder and executed "sqlite3" from there, but .database command doesn't returns my databases.

Upvotes: 1

Views: 5037

Answers (1)

Vladimir Ivanov
Vladimir Ivanov

Reputation: 43088

There is a special tool in your sdk folder tools. It is called sqlite3. Read more here.

THere you'll find all the necessary information like:

From an adb remote shell, 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

Upvotes: 2

Related Questions