blob: 9cc7e9831a5b3815321be0e977f17bee1954dae4 [file] [log] [blame]
<p>From a remote shell to your device or from your host machine, you can use the <a href=
"">sqlite3</a> command-line program to manage SQLite databases
created by Android applications. The <code>sqlite3</code> tool includes many useful commands,
such as <code>.dump</code> to print out the contents of a table and <code>.schema</code> to print
the SQL CREATE statement for an existing table. The tool also gives you the ability to execute
SQLite commands on the fly.</p>
<p>To use <code>sqlite3</code> from a remote shell:</p>
<li>Enter a remote shell by entering the following command:
<pre>adb [-d|-e|-s {&lt;serialNumber&gt;}] shell</pre>
<li>From a remote shell, start the <code>sqlite3</code> tool by entering the following command:
<p>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
<li>Once you invoke <code>sqlite3</code>, you can issue <code>sqlite3</code> commands in the
shell. To exit and return to the adb remote shell, enter <code>exit</code> or press
<p>Here's an example:</p>
<pre>$ adb -s emulator-5554 shell
# sqlite3 /data/data/
SQLite version 3.3.12
Enter ".help" for instructions
<em>.... enter commands, then quit...</em>
# sqlite&gt; .exit
<p>To use <code>sqlite3</code> locally, instead of within a shell,
pull the database file from the device and start {@code sqlite3}:</p>
<li>Copy a database file from your device to your host machine:
adb pull &lt;database-file-on-device&gt;
<li>Start the sqlite3 tool from the <code>/tools</code> directory, specifying the database
sqlite3 &lt;database-file-on-host&gt;