In the figure above, except for the last red box, the other boxes are commands under the ADB shell.
"1" in the Android program, databases that are typically created are stored in the directory of the/data/data/[application package name]/databases.
"2" CD command: Folder Jump command. ls command: See what files are under a folder.
"3" uses the Sqlite3 [database name] command to perform a series of operations on a database.
"4" After the "3" step, you can use the. Tables command to see which tables are included in a database. To query the data contained in a table, enter the query's SQL statement after the sqlite> command, but be aware of the semicolon [;] To end the input of the statement.
"5" If you enter the ADB shell at the command line, it prompts: The ADB is not an internal or external command, nor a running program, or a batch file, which is caused by an issue where the environment variable is not set up properly. Workaround: Locate the ADB tools directory in the installed Android SDK package directory, usually in the ... \android-sdk-windows\tools directory or in ... \android-sdk-windows\ The Platform-tools directory. Adding the directory to the PATH environment variable is OK.
PS: Command line view Android SQLite database
Command line View SQLite database:
Start simulator
Command line CD to android-sdk-windows\platform-tools directory
adb shell //Enter emulator
cd/data/data/ yourpackagename/ //Enter the software installation directory
CD databases //Enter to the database directory
ls // View an existing database, if you have created a xxxx.db
sqlite3 xxxx.db //Open database with the Sqlite3 tool
//Below is the sqlite3 command
Sqlite>. tables //View the tables in the database This example should be able to see the table YYYY
sqlite>. Schema yyyy //view table structure
sqlite> SELECT * FROM yyyy; //query table