Android adb commonly used 50 commands

1. adb devices - lists all connected Android devices and emulators  
2. adb shell - launches the shell terminal of the Android device or emulator 
3. adb install - installs the APK file 
4. adb uninstall - uninstalls the APK file 
5. adb logcat - View log output information for debugging applications
6. adb push - push files to Android devices 
7. adb pull - pull files from Android devices 
8. adb reboot - restart Android devices 
9. adb kill-server - terminate adb server Process 
10. adb start-server - Start the adb server process
11. adb get-state - Get the current state of the Android device 
12. adb remount - Remount the Android system partition as readable and writable 
13. adb root - Restart adbd with root privileges Run 
14. adb unroot - restarts adbd to run as non-root  
15. adb bugreport - generates a log file with device information and a list of installed apps 
16. adb backup - takes a backup of the device 
17. adb restore - restores from a previous backup equipment 
18. adb sideload - Push and install OTA packages in zip format using recovery mode
19. adb sync - Synchronize the built-in SQLite database to the parent directory 
20. adb wireless - connect Android devices wirelessly (Android 11+) 21. pm list packages - List the application package name installed on the device 
22. pm path package name - print the data storage path corresponding to the application package name   
23. pm dump package name - display application details
24. pm disable-user package name - disable the application
25. pm enable package name - enable application 
26. dumpsys activity package name/main Activity - output application main Activity information 
27. am start package name/main Activity - start application main Activity
28. am force-stop package name - stop application 
29. ps | grep package name - View application process 
30. top -m 5 | head -n 20 - Query the CPU usage of the top 20 processes every 5 seconds

31. top -m 5 -t package name | head -n 20 - query the CPU usage of the package name process every 5 seconds 
32. dumpsys meminfo package name - view the application memory usage 
33. cat /proc/meminfo - view the device Total memory information34 
. cat /sys/class/net/wlan0/statistics/tx_bytes - view the number of bytes sent by WLAN35. 
cat /sys/class/net/wlan0/statistics/rx_bytes - view the number of bytes received by
WLAN36 .netstat -nap | grep port number - view the socket network connection information of the specified port number
37. ip addr show wlan0 - view the IP address of WLAN 
38. ifconfig wlan0 - view the IP address of WLAN (old) 
39. sqlite3 /data/data /packagename/databasename - enter the application's SQLite database 
40. run-as packagename - run the shell as the application 
41. monkey -p packagename -v 500 - send 500 pseudo-random events to the application to stress test 
42. watch -n 1 "dumpsys gfxinfo package name" - monitor application frame rate information 
43. screenrecord /sdcard/demo.mp4 - record device screen, output as MP4 video file
44. dumpsys power | grep mScreenOn|cut -f2 -d'=' - check screen status (on/off)
45. dumpsys power | grep 'Display Power: state=' - check screen status (on/off) 
46. dumpsys display - view information such as screen size and density 
47. adb shell wm size - view screen size 
48. adb shell wm density - view screen density
49. adb shell getprop | grep ro.sf.lcd_density - view screen density 
50. aapt dump permissions Package name.apk - View APK permission information

Guess you like

Origin blog.csdn.net/tiandiyinghun/article/details/124653860