Record your frequently used adb commands, record them for yourself as a memo, and will update them irregularly in the future
For the most detailed and accurate description of the adb command, see: https://developer.android.com/studio/command-line/adb
- connect device
adb devices -l: -l details
adb -e shell: connect emulator
adb -d shell: connect devices
adb -s xxxxx
- pm
View all package installation paths and apk paths (you can use adb shell pull xxxpath.apk to take out the apk)
adb shell pm list packages -f
- Read all contacts (read through sqlite DB)
adb shell content query --uri content://contacts/phones/ --projection display_name:number:notes
- List all services
adb shell service list
- View all activities
adb shell dumpsys activity activities
- List all activities on the stack
am stack list
- keyevent
锁屏:adb shell input keyevent 26
- dumpsys input | grep TouchStates -A10
手点击某个window
然后输入命令
就能看到自己点击的具体是哪个window
- View app installer
adb shell pm list packages -i