Adb shell usage tutorial + sqlite3 usage example

Article Directory

One, about the understanding of adb shell

adb is called Android Debug Bridge, which means Android Debug Bridge, which is a tool in Android SDK.

The shell is a command parser. In Linux, it is both a command parser and a high-level programming language.

Second, the use of adb shell

The premise is to make sure that the computer is connected to the mobile phone or simulator (I use the lightning simulator):

Insert picture description here

1. The general way to enter adb shell

1) Enter the …/sdk/platform-tools directory:

Insert picture description here


2) Type cmd at the top of the directory, and then press Enter:

Insert picture description here



3) A cmd window appears:

Insert picture description here

4) Just type adb shell: (please ignore the garbled characters, and find a lot of posts It does not work, but does not affect the use)

Insert picture description here

2. Easier way to enter adb shell

1) New system variable:

Insert picture description here


2) Input variable name and variable value, the variable value is two paths, …\sdk\tools and …\sdk\platform-tools:

Insert picture description here


mine is like this:

Insert picture description here


3) Edit system variable Path:

Insert picture description here


4) Add the newly created system variable:

Insert picture description here


5) WIN+R enter the cmd window, and directly enter adb shell:

Insert picture description here

Three, use sqliet3 to operate the database

1) First cd /data/data/package name/databases/, then sqlite3 database name, enter the "sqlite> _" mode and
insert a record into the existing table:

Insert picture description here


Insert picture description here