Squarelite 3
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Von einer Remote-Shell auf Ihr Gerät oder von Ihrem Hostcomputer aus mit dem sqlite3
-Befehlszeilentool
Von Android-Anwendungen erstellte SQLite-Datenbanken. Das sqlite3
-Tool enthält viele
nützliche Befehle verwenden, wie z. B. .dump
, um den Inhalt einer Tabelle auszudrucken, und
.schema
, um die SQL-CREATE-Anweisung für eine vorhandene Tabelle auszugeben. Das Tool bietet außerdem
können Sie SQLite-Befehle spontan ausführen.
Weitere Informationen finden Sie im SQLite-
-Dokumentation. Weitere Informationen finden Sie unter
sqlite3
und die
Unterstützte SQL-Sprachspezifikation
von SQLite.
So verwenden Sie sqlite3
über eine Remote-Shell:
- Geben Sie den folgenden Befehl ein, um eine Remote-Shell aufzurufen:
adb [-d|-e|-s {<serialNumber>}] shell
- Starten Sie über die Remote-Shell das
sqlite3
-Tool mit dem folgenden Befehl:
sqlite3
Sie können auch einen vollständigen Pfad zu einer Datenbank angeben, die Sie untersuchen möchten.
Emulator-/Geräteinstanzen speichern SQLite-Datenbanken im Verzeichnis
/data/data/<package_name>/databases/
- Sobald Sie
sqlite3
aufgerufen haben, können Sie
in der Shell. Um zur ADB-Remote-Shell zurückzukehren, geben Sie
exit
oder drücken Sie Strg + D.
Beispiel:
$ 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
Hinweis:Sie benötigen Root-Zugriff auf das Dateisystem, um Dateien ansehen zu können.
innerhalb der /data/data
-Verzeichnishierarchie.
Wenn Sie sqlite3
lokal statt in einer Shell verwenden möchten,
Rufen Sie die Datenbankdatei vom Gerät ab und starten Sie sqlite3
:
- Kopieren Sie eine Datenbankdatei von Ihrem Gerät auf Ihren Hostcomputer:
adb pull <database-file-on-device>
- Starten Sie das
sqlite3
-Tool und geben Sie die Datenbankdatei an:
sqlite3 <database-file-on-host>
Alle Inhalte und Codebeispiele auf dieser Seite unterliegen den Lizenzen wie im Abschnitt Inhaltslizenz beschrieben. Java und OpenJDK sind Marken oder eingetragene Marken von Oracle und/oder seinen Tochtergesellschaften.
Zuletzt aktualisiert: 2025-07-27 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-27 (UTC)."],[],[],null,["# sqlite3\n\nFrom a remote shell to your device or from your host machine, use the [`sqlite3`](https://www.sqlite.org/) command-line program to manage\nSQLite databases created by Android applications. The `sqlite3` tool includes many\nuseful commands, such as `.dump` to print out the contents of a table and\n`.schema` to print the SQL CREATE statement for an existing table. The tool also gives\nyou the ability to execute SQLite commands on the fly.\n\nRefer to the [SQLite\ndocumentation](https://sqlite.org/docs.html) for full details. For additional documentation, visit\n[`sqlite3`](https://sqlite.org/cli.html) and the\n[SQL language specification](https://sqlite.org/lang.html) supported\nby SQLite.\n\nTo use `sqlite3` from a remote shell:\n\n1. Enter a remote shell by entering the following command: \n\n ```\n adb [-d|-e|-s {\u003cserialNumber\u003e}] shell\n ```\n2. From the remote shell, start the `sqlite3` tool by entering the following command: \n\n ```\n sqlite3\n ```\n\n You can also optionally specify a full path to a database that you want to explore.\n Emulator/device instances store SQLite databases in the directory\n `/data/data/\u003cpackage_name\u003e/databases/`.\n3. Once you invoke `sqlite3`, you can issue commands in the shell. To exit and return to the adb remote shell, enter `exit` or press Control+D.\n\nFor example: \n\n```\n$ adb -s emulator-5554 shell\n# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db\nSQLite version 3.3.12\nEnter \".help\" for instructions\n.... enter commands, then quit...\n# sqlite\u003e .exit\n```\n\n**Note:** You need root access to the file system to view files\nwithin the `/data/data` directory hierarchy.\n\nTo use `sqlite3` locally, instead of within a shell,\npull the database file from the device and start `sqlite3`:\n\n1. Copy a database file from your device to your host machine: \n\n ```\n adb pull \u003cdatabase-file-on-device\u003e\n ```\n2. Start the `sqlite3` tool, specifying the database file: \n\n ```\n sqlite3 \u003cdatabase-file-on-host\u003e\n ```"]]