Commonly used adb command records

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

  1. connect device
adb devices -l: -l details
adb -e shell: connect emulator
adb -d shell: connect devices
adb -s xxxxx
  1. 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
  1. Read all contacts (read through sqlite DB)
adb shell content query --uri content://contacts/phones/  --projection display_name:number:notes
  1. List all services
adb shell service list
  1. View all activities
adb shell dumpsys activity activities
  1. List all activities on the stack
am stack list
  1. keyevent
锁屏:adb shell input keyevent 26
  1. dumpsys input | grep TouchStates -A10
手点击某个window
然后输入命令
就能看到自己点击的具体是哪个window
  1. View app installer
adb shell pm list packages -i

Guess you like

Origin blog.csdn.net/ybdesire/article/details/128414781