Adb commands that Android development must know

Android adb command list

description command
1. Query connected devices/emulators adb devices
2. Specify the device to obtain the screen resolution adb -s device number shell wm size
3. Install apps on designated devices adb -s device number install test.apk
4. Start the adb server command adb start-server
5. Stop the adb server command adb kill-server
6. Check the adb version adb version
7. Specify the network port of the adb server adb -P start-server
8. Connect the device via IP address adb connect
9. Disconnect the wireless connection adb disconnect
10. View all applications adb shell pm list packages
11. View system applications adb shell pm list packages -s
12. View third-party applications adb shell pm list packages -3
13. Uninstall the application (indicating the package name of the application, the -k parameter is optional, meaning that the application is uninstalled but the data and cache directory are retained.) adb uninstall [-k]
14. Clear application data and cache adb shell pm clear
15. Copy the files in the device to the computer adb pull <file path in device> [directory on computer]
16. Copy files from the computer to the device adb push <file path on computer> <directory in device>
17. Power button adb shell input keyevent 26
18. Menu key adb shell input keyevent 82
19, HOME Key adb shell input keyevent 3
20. Back button adb shell input keyevent 4
21, increase the volume adb shell input keyevent 24
22. Lower the volume adb shell input keyevent 25
23. Mute adb shell input keyevent 164
24, play/pause adb shell input keyevent 85
25, stop playing adb shell input keyevent 86
26, play the next song adb shell input keyevent 87
27, play the previous song adb shell input keyevent 88
28, resume playback adb shell input keyevent 126
29, pause playback adb shell input keyevent 127
30. Slide to unlock (parameters 300 1000 300 500 respectively represent starting point x coordinate starting point y coordinate ending point x coordinate ending point y coordinate.) adb shell input swipe 300 1000 300 500
31. Enter text adb shell input text hello
32, clear the log adb logcat -c
33. Check the device model adb shell getprop ro.product.model
34. Battery status adb shell dumpsys battery
35. Screen resolution adb shell wm size
36, screen density adb shell wm density
37. Display parameters adb shell dumpsys window displays
38. Check the Android system version adb shell getprop ro.build.version.release
39. Check the IP address adb shell ifconfig
40, Mac address adb shell cat /sys/class/net/wlan0/address
41, CPU information adb shell cat /proc/cpuinfo
42, memory information adb shell cat /proc/meminfo
43. Use Monkey for stress testing (means sending 500 pseudo-random events to the specified application.) adb shell monkey -p -v 500
44, view the process adb shell ps
45. View real-time resource usage adb shell top

关注我,了解更多Android开发知识
在这里插入图片描述

Guess you like

Origin blog.csdn.net/qq_43804080/article/details/107037817