adb shell dumpsys activity | findstr "mFocusedActivity"
adb shell dumpsys activity | grep "mFocusedActivity"
adb shell dumpsys activity | grep -i run
安卓11:
Activity:
adb shell dumpsys activity top | grep ACTIVITY | tail -n 1
Fragment:
adb shell dumpsys activity top | grep '#0: ' | tail -n 1
Stack:
adb shell dumpsys activity | grep '* ActivityRecord{'