查看当前Activity:
adb shell "dumpsys window w | grep name="查看当前栈顶的Activity:
adb shell dumpsys activity | grep "mFocusedActivity"查看当前栈顶的Activity的Fragment:
adb shell dumpsys activity your.package.name
或者:adb shell dumpsys activity top查看帮助:
adb shell dumpsys activity -h
补充:一些其他的ADB命令
查看当前与用户交互的activity:
adb shell dumpsys activity activities | sed -En -e '/Running activities/,/Run #0/p'
或者:adb shell dumpsys activity | grep -i run显示当前所有在运行的任务栈,并可查看栈中所有的 Activity 的列表
adb shell dumpsys activity activities获取当前 Android 系统 Activity 栈中 Activity 信息
adb shell dumpsys activity