ADB - Android - Getting the name of the current activity

manugupt1 picture manugupt1 · Nov 2, 2012 · Viewed 146.1k times · Source

Is there a way to get the details of the current activity that is running via adb.

Answer

Alex P. picture Alex P. · Nov 3, 2012

I prefer parsing results of dumpsys window windows over dumpsys activity

adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'

Keyguard or Recent tasks list used to not show up as Activities but you were able to see them with mCurrentFocus. I have explained why in this answer.