adb常用命令

1.安装apk 

adb install C:\Users\lizhe15\Documents\daiketong_guanjia-1.12.0-2021-01-14.apk

2.查看指定app的packgename和activity 

  注:可以不加双引号

aapt dump badging apk_path | find "package"

aapt dump badging apk_path | find "launchable-activity"

3.获取当前活动activity

  真机  

    8.1之前

      window 通过adb shell dumpsys activity | findstr “mFocus”
      Linux 通过adb shell dumpsys activity | grep “mFocus”

    8.1

      window 通过adb shell dumpsys activity | findstr “mResume”
      Linux 通过adb shell dumpsys activity | grep “mResume”

     Mac

                  adb shell dumpsys window | grep mCurrentFocus

  模拟器

      adb shell dumpsys activity | findstr "mFocusedActivity"

 4.重启设备

             adb reboot

 

 

 

 

 

posted @ 2022-05-18 15:43  Wiselee😏  阅读(62)  评论(0编辑  收藏  举报