How to access SQLite using ADB in Android

Source: Internet
Author: User

(1) Open a command prompt, enter: adb, press ENTER, if you get the following a large set of command instructions (1), indicating that the ADB configuration is successful, if prompted "is not an internal or external command, is not a running program or batch file", Then you need to add the directory of Adb.exe files in ANDROIDSDK to the environment variables of the system.

Figure 1

(2) Enter the ADB shell and enter the Linux command environment. (2)

Figure 2

(3) Enter the CD data, enter, enter the root directory of the data folder, 3.

Figure 3

(4) Enter the Ls–l command to view the files under the Data folder, 4.

Figure 4

You can see the Data folder also has a data, we leaf out, again into the Data folder, with Ls–l display the contents of the folder, you can view the Data folder contains a lot of folders (5). Each Android program will generate the corresponding folder here, which is the application-related database.

Figure 5

(5) Use the CD command to access the folder you want to view (the folder name is typically the application's package name), you can see the application's database, you can see that there are two databases in Mar.sqlite3, one is databases, one is LIB. (6)

Figure 6

(6) using the CD Databases command to enter the databases database, and then using the Ls–l command, you can see a database named "test_mars_db" under the database, 7.

Figure 7

(7) So how to operate this database? Using Sqlite3 xxxxx (xxxxx is the database name) into SQLite operating environment (8), where "sqlite>" is similar to the "mysql>" in MySQL, the rest of the operation is almost the same as the SQL operation.

Figure 8

(8) For example, to view the contents of the user table, enter "SELECT * from User;" To get the contents of the user table. (9)

Figure 9


Source: http://blog.sina.com.cn/s/blog_3fe961ae0100qrxn.html



From for notes (Wiz)

How to access SQLite using ADB in Android

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.