View activity stack in Android

30,761

To display the activity stack, run the following command :

adb shell dumpsys activity activities
Share:
30,761
hpique
Author by

hpique

iOS, Android & Mac developer. Founder of Robot Media. @hpique

Updated on July 05, 2022

Comments

  • hpique
    hpique almost 2 years

    Is it possible to view the activity stack in Android for debugging purposes?

  • Kevin McMahon
    Kevin McMahon over 11 years
    and if you do adb shell dumpsys activity activities you'll get a smaller amount of info which includes the running tasks, activities and recent tasks.
  • loeschg
    loeschg over 11 years
    Building off this, this piped command is quite handy (from another SO thread) adb shell dumpsys activity | grep -i run
  • Gagandeep Singh
    Gagandeep Singh over 8 years
    adb shell dumpsys activity | grep -i 'run' | grep -i 'com.example.package'
  • Nathan H
    Nathan H about 8 years
    is there a way to watch it live and not a snapshot? Things are happening too fast...
  • Mr. Bungle
    Mr. Bungle almost 8 years
    @Nathan H - assuming you are on linux, you can use the watch command: watch -n 1 "adb shell dumpsys activity | grep -i com.yourapp"
  • Vikas Pandey
    Vikas Pandey over 7 years
    where do i run this command?