Android开发常用几个adb命令

释放双眼,带上耳机,听听看~!

Android开发常用几个adb命令

(1)安装apk进手机

               1.adb push D:****\KeyboardManMan.apk  system/vital-app

               2.adb install C:\Users\Administrator\Desktop\傣文输入法.apk


 (2)将手机数据导出到本地电脑中:
            adb pull /storage/sdcard0/.****/tempimg/1539746354759.jpg C:\Users\Mr.Yang\Desktop\tup

(3)查看当前的activity

        1.adb shell dumpsys activity | findstr "mFocus"

  结果:
  mFocusedActivity: ActivityRecord{7dee184 u0 **************.activity.*******Activity t861}
  mFocusedStack=ActivityStack{3d567e9f stackId=1, 6 tasks}                                                                 mLastFocusedStack=ActivityStack{3d567e9f stackId=1, 6 tasks}
    

   2.adb shell " dumpsys activity | grep -i run"

结果:

 Running activities (most recent first):
        Run #4: ActivityRecord{2d54a214 u0 com.******/com.*******.activity.GuideActivity t897}
        Run #3: ActivityRecord{2c939c21 u0 com.tencent.mm/.ui.LauncherUI t791}
        Run #2: ActivityRecord{3949b73b u0 com.android.filemanager/.FileManagerActivity t839}
        Run #1: ActivityRecord{bc7145f u0 com.iqoo.secure/.ui.phoneoptimize.PhoneCleanActivity2 t838}
        Run #0: ActivityRecord{b4bf469 u0 com.iqoo.secure/.MainActivity t838}
    Running activities (most recent first):
        Run #0: ActivityRecord{d98b5c4 u0 com.bbk.launcher2/.Launcher t749}
ACTIVITY MANAGER RUNNING PROCESSES (dumpsys activity processes)

   3.adb shell " dumpsys activity | grep "mFoc" "

结果:

    mFocusedActivity: ActivityRecord{2d54a214 u0 com.*******/com.**********.activity.GuideActivity t897}
    mFocusedStack=ActivityStack{3d567e9f stackId=1, 5 tasks} mLastFocusedStack=ActivityStack{3d567e9f stackId=1, 5 tasks}

  4.adb shell "dumpsys activity | grep mFocusedActivity"

  结果:

  mFocusedActivity: ActivityRecord{2d54a214 u0 com.*******/com.********.activity.GuideActivity t897}

(4)查看手机分辨率

      adb shell wm size

     结果:

       Physical size: 1080x1920

(5)activity栈的显示和活动状态

         adb shell dumpsys activity

ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom):
  Stack #1:
    Task id #897(任务栈)
      TaskRecord{1ceb7ecd #897 A=com.umi.niuniu U=0 sz=1}
      Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.*********/com.*********.activity.GuideActivity }  (activity的记录)
        Hist #0: ActivityRecord{2d54a214 u0 com.*********/com.*********.activity.GuideActivity t897}
          Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.*********/com.*********.activity.GuideActivity }
          ProcessRecord{3dc521d2 1929:com.*******/u0a282}

 

人已赞赏
Android文章

android开发Collections.sort排序的一种使用

2021-2-1 11:24:53

Android文章

Android开发异步调用websevice接口

2021-2-1 12:07:22

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索