查看当前显示的页面是哪个Activity、Fragment
查看当前页面是哪个Activity
- 方式一
adb shell "dumpsys window w | grep name="
# 或者
adb shell dumpsys window w | findstr name=
2. 方式二
adb shell "dumpsys activity activities | grep mResumedActivity"
# 或者
adb shell dumpsys activity activities | findstr mResumedActivity
查看当前显示的Fragment
adb shell dumpsys activity packagename
# 本处为
adb shell dumpsys activity com.android.settings/com.oneplus.security.network.view.TrafficUsageSettingsActivity
- 输入前面查看的Activity名称
- 此命令输出有点多,直接看最后