SoFunction
Updated on 2025-03-03

The most complete summary of adb command in android

1. Check the adb version

adb version

C:\Users\Administrator>adb version
Android Debug Bridge version 1.0.41
Version 30.0.4-6686687
Installed as E:\platform-tools\

2. Check the connected devices

adb devices

C:\Users\Administrator>adb devices
List of devices attached
127.0.0.1:7555  device

3. Obtain the phone serial number

adb get-serialno

C:\Users\Administrator>adb get-serialno
127.0.0.1:7555

4. Check the phone's design model

adb shell getprop

C:\Users\Administrator>adb shell getprop 
Xiaomi

5. Check the resolution of the phone

adb shell wm size

C:\Users\Administrator>adb shell wm size
Physical size: 1440x810

6. Get the mac address of your phone

adb shell cat /sys/class/net/wlan0/address

C:\Users\Administrator>adb shell cat /sys/class/net/wlan0/address
08:00:27:7e:49:9c

7. View the log

adb logcat

C:\Users\Administrator>adb logcat

8. Check battery information

adb shell dumpsys battery

C:\Users\Administrator>adb shell dumpsys battery
Current Battery Service state:
  AC powered: true
  USB powered: false
  Wireless powered: false
  Max charging current: 2000000
  status: 2
  health: 2
  present: true
  level: 72
  scale: 100
  voltage: 4036
  temperature: 326
  technology: Li-poly

9. Check the process

adb shell ps

C:\Users\Administrator>adb shell ps
USER      PID   PPID  VSIZE  RSS   WCHAN            PC  NAME
root      1     0     2732   1272     ep_poll 08126b35 S /init
root      2     0     0      0       kthreadd 00000000 S kthreadd
root      3     2     0      0     smpboot_th 00000000 S ksoftirqd/0
root      5     2     0      0     worker_thr 00000000 S kworker/0:0H

10. Check the CPU usage

adb shell top

C:\Users\Administrator>adb shell top

11. Install apk

  • The apk file needs to be placed in the folder where your command is executed, or write the absolute path of the apk
  • adb install [path of apk file]
C:\Users\Administrator>adb install 
Performing Push Install
  • Multiple devices install apk
  • adb -s [device number] install [path of apk file]
C:\Users\Administrator>adb -s 127.0.0.1:7555 install 
Performing Push Install
  • If the apk already exists, it is necessary to override the installation
  • adb install -r [path of apk file]
C:\Users\Administrator>adb install -r 
Performing Push Install

12. Uninstall apk

  • Normal uninstall
  • adb uninstall [path of apk file]
C:\Users\Administrator>adb uninstall 
  • Uninstall but keep data
  • adb uninstall -k [path of apk file]
C:\Users\Administrator>adb uninstall -k 

13. Check all the app package names installed on your phone

adb shell pm list packages

C:\Users\Administrator>adb shell pm list packages
package:
package:.
package:
package:
package:
package:.
package:

14. Get the startup portal of a certain application package name

  • adb shell dumpsys package | findstr activity
  • / This is the startup entrance of Douyin
C:\Users\Administrator>adb shell dumpsys package  | findstr activity
        ad29111 /

15. Start an app

adb shell am start -n [package name]/[start portal]

C:\Users\Administrator>adb shell am start -n /
vity
Starting: Intent { cmp=/ }

16. Screenshot

adb shell screencap [save path]

C:\Users\Administrator>adb shell screencap /sdcard/

17. Record video

adb shell screenrecord [Save path]

C:\Users\Administrator>adb shell screenrecord /sdcard/demo.mp4

18. Upload files to your mobile phone

adb push file name SDCard path on mobile

C:\Users\Administrator>adb push  sdcard/

19. Download files from mobile phone

adb pull [File path on mobile phone]

C:\Users\Administrator>adb pull sdcard/

20. Simulate screen click event

adb shell input tap x axis y axis

C:\Users\Administrator>adb shell input tap 500 1450

21. Simulate gesture sliding event

adb shell input swipe Start x-axis Start y-axis End x-axis End y-axis Process duration milliseconds

C:\Users\Administrator>adb shell input swipe 100 500 100 1450 100

22. Simulate clicking the keyboard button

adb shell input keyevent [key value]

C:\Users\Administrator>adb shell input keyevent 25

23. Enter some information into the screen

  • db shell input text [String information]
  • %s is a space
C:\Users\Administrator>db shell input text "insert%stext%shere"

24. Send broadcast

adb shell am broadcast -a "broadcastactionfilter"

C:\Users\Administrator>adb shell am broadcast -a "broadcastactionfilter"

25. Open the web page with your own browser

adb shell am start -a [browser package name] -d [website]

C:\Users\Administrator>adb shell am start -a "" -d 

26. Obtain root permissions for mobile phones

adb vivoroot

C:\Users\Administrator>adb vivoroot

27. If the connection is unstable, it needs to be mounted.

adb remount

C:\Users\Administrator>adb remount

28. Restart your phone

Restart normally

C:\Users\Administrator>adb reboot

Restart your phone to recovery

C:\Users\Administrator>adb reboot recovery

Restart to bootloader interface

C:\Users\Administrator>adb reboot bootloader

29. Close adb service

C:\Users\Administrator>adb kill-server

30. Start the adb service

C:\Users\Administrator>adb start-server

This is the introduction to this article about the most comprehensive summary of adb commands in android. For more related android adb commands, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!