“This is the sixth day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”

Command to view the list of connected devices

adb devices

How do I access the Shell interface

adb shell

View the installed package names and third-party applications

adb shell pm list packages

adb shell pm list packages -3

 

View system running activities and current activities

adb shell dumpsys activity top | grep ACTIVITY

Check the app version number:

adb shell pm dump | grep version

Install the apk

Adb install -r “adb install -r

Adb install adb install adb install adb install

 

Adb gets the current package name

adb shell am monitor

Adb finds APK by package name

The adb shell PM list packages – f | grep package name

 

Exporting Log Files

Adb logcat > local file.txt

Clear the log

adb logcat -c

The device file is imported to the local PC

Adb pull < adb pull >

Local files are imported to the device

Adb push < local > < device >

If more than one device is found, how to determine and operate the device:

Adb Devices after the adB-S device number other instructions

Screen capture and screen video commands

Adb shell screencap /sdcard/screen.png:

adb shell screenrecord /sdcard/demo.mp4

Adb command to simulate pressing the entity button command, such as turning down the volume

adb shell input keyevent 25

Use the ADB shell input swipe command to simulate a gesture swipe event, for example, starting at screen coordinates (100,500) and ending at screen coordinates (100,1450), taking 100ms.

adb shell input swipe 100 500 100 1450 100

 

How do I view running Services

adb shell dumpsys activity services []

 

 

View the application installation path

adb shell pm path

Restart to Fastboot mode

adb reboot bootloader

View the Bug Report (Bugreport)

adb bugreport

Restart ADB as root

adb root

Remount the system partition as a read-write partition. This command is important when operating system directories

adb remount

Clear APP data

adb shell pm clear