ADB command specific Explanation (ii)--a variety of solutions to the operation database when the mobile phone is missing sqlite3

Source: Internet
Author: User
Tags sqlite database import database

In the Android app development everywhere SQLite database figure. So how do you use the ADB command to manipulate the database in development?

The following is a complete description of the command set associated with database operations and the various workarounds when the phone lacks sqlite3.

1. How to operate the database when the phone is missing sqlite3

First look at the phone missing sqlite3 time:

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center "/>

This time you want to manipulate the contents of the database file that you just wrote running in the application. The SQL statement is obviously not running. Here are three ways that you can view the database files under your application:

㈠ importing sqlite3 files to your phone

① first step, download Sqlite3 file

Please download it to http://www.sqlite.org/download.html. Since Android is a Linux-based development, select Linux download package.

After decompression, copy out the Sqlite3 file to a folder that is easy to operate with the cmd command line.

② get root permissions, mount the system partition, and allow the system partition to read and write again

The adb root command gets root privileges

ADB remount mount system partition

③ after running ②, you can import sqlite3 files to your phone

ADB push E:\sqlite3/system/bin

④ uses the ADB shell to enter the shell command mode, giving the file readable and writable.

ADB shell

Su

chmod 777/system/bin/sqlite3

⑤ Entering database folder operations database

cd/data/data/Application Package Name/databases

LS Lists the database files

Sqlite3 students.db access to operational database directives

The following is the ability to run the SQL statement you want, the following are all the commands:

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center "/>

㈡ Importing database files in Windows system operations

① Export the database file to the folder you specified

ADB pull/data/data/Application Package name/databases/students.db

② Download Window's sqlite3 package. Extract. Same download URL for http://www.sqlite.org/download.html

③ into the extracted Sqlite3 folder, manipulate the database file

Commands such as the following:

㈢ Import Database File Open database file directly with software

This does not belong to the scope of the program, this belongs to the computer application, please go to the Web site to see for yourself:

Http://jingyan.baidu.com/article/e8cdb32b4343e637052bad0f.html

2. Mobile phone with sqlite3 operation database

The preceding commands are described. The direct explanation.

ADB command specific Explanation (ii)--a variety of solutions to the operation database when the mobile phone is missing sqlite3

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.