adb 命令记录

adb常用命令:

1. 获取包名

# Mac
adb shell dumpsys window | grep  mCurrentFocus
# 或者
adb shell dumpsys window windows | grep mFocusedApp



# Windows
adb shell dumpsys window | findstr mCurrentFocus

 

 

2. 获取当前页面的activity

# Mac
adb shell dumpsys activity top | grep "ACTIVITY"

# Windows
adb shell dumpsys activity top | find "ACTIVITY"

 

3. 获取app的启动activity

# Mac
adb shell dumpsys package com.tencent.mm | grep -B2 "category.LAUNCHER"  # 其中com.tencent.mm是包名

 

 

 

  

 

posted @ 2019-05-09 09:14  KS毛毛虫  阅读(292)  评论(0编辑  收藏  举报