Use the ADB command to view databases in Android

Source: Internet
Author: User

In the case of database operations, the execution of operations statements such as queries or deletions often fails, but there is no specific reason for finding them. The following is a command-line way to perform database operations to verify that the database operation statements in Android are correct, and so on.

The following are the steps:

(1) Enter into the console, enter the ADB shell, into the command mode environment;

(2) Input command: cd/data/data/

(3) Input command: CD com.android.***, enter your database file (where com.android.*** is the file where your database resides);

(4) You can use the Ls-l command to view the files in the current directory;

(5) Input: CD databases into the database file;

(6) (optional) via the command line: LS-L Displays the database you created in your database;

(7) Input: Sqlite3 info.db into the database of your choice;

(8) Input:. Tables view the table you built;

(9) Input: SELECT * FROM table_name, can view the whole table information;

Note: After you manipulate the statement, you must add ";" to the end, otherwise you will always be waiting for the input state.

(10) At this point, you can use other SQL statements to further manipulate the table.

The details of this step are as follows:

Use the ADB command to view databases in Android

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.