diff options
| author | Scott Main <smain@google.com> | 2012-06-21 17:14:39 -0700 |
|---|---|---|
| committer | Scott Main <smain@google.com> | 2012-06-21 21:27:30 -0700 |
| commit | 50e990c64fa23ce94efa76b9e72df7f8ec3cee6a (patch) | |
| tree | 52605cd25e01763596477956963fabcd087054b0 /docs/html/tools/help/sqlite3.jd | |
| parent | a2860267cad115659018d636bf9203a644c680a7 (diff) | |
| download | frameworks_base-50e990c64fa23ce94efa76b9e72df7f8ec3cee6a.zip frameworks_base-50e990c64fa23ce94efa76b9e72df7f8ec3cee6a.tar.gz frameworks_base-50e990c64fa23ce94efa76b9e72df7f8ec3cee6a.tar.bz2 | |
Massive clobber of all HTML files in developer docs for new site design
Change-Id: Idc55a0b368c1d2c1e7d4999601b739dd57f08eb3
Diffstat (limited to 'docs/html/tools/help/sqlite3.jd')
| -rw-r--r-- | docs/html/tools/help/sqlite3.jd | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/docs/html/tools/help/sqlite3.jd b/docs/html/tools/help/sqlite3.jd new file mode 100644 index 0000000..9cc7e98 --- /dev/null +++ b/docs/html/tools/help/sqlite3.jd @@ -0,0 +1,59 @@ +page.title=sqlite3 +parent.title=Tools +parent.link=index.html +@jd:body + + <p>From a remote shell to your device or from your host machine, you can use the <a href= + "http://www.sqlite.org/sqlite.html">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> + + <ol> + <li>Enter a remote shell by entering the following command: + <pre>adb [-d|-e|-s {<serialNumber>}] shell</pre> + </li> + + <li>From a remote shell, start the <code>sqlite3</code> tool by entering the following command: + <pre>sqlite3</pre> + + <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 + <code>/data/data/<package_name>/databases/</code>.</p> + </li> + + <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 + <code>CTRL+D</code>.</li> + </ol> + + + <p>Here's an example:</p> + <pre>$ 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 +<em>.... enter commands, then quit...</em> +# sqlite> .exit +</pre> + + <p>To use <code>sqlite3</code> locally, instead of within a shell, + pull the database file from the device and start {@code sqlite3}:</p> + + <ol> + <li>Copy a database file from your device to your host machine: + <pre> +adb pull <database-file-on-device> +</pre> + </li> + + <li>Start the sqlite3 tool from the <code>/tools</code> directory, specifying the database + file: + <pre> +sqlite3 <database-file-on-host> +</pre> + </li> + </ol>
\ No newline at end of file |
