Is it possible to view the activity stack in Android for debugging purposes?
Asked
Active
Viewed 3.3k times
76
-
this is a duplicate of http://stackoverflow.com/questions/2442713/view-the-tasks-activity-stack – andr Dec 07 '12 at 06:16
1 Answers
136
To display the activity stack, run the following command :
adb shell dumpsys activity activities

Dalmas
- 26,409
- 9
- 67
- 80
-
5and 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. – Kevin McMahon Nov 16 '12 at 01:39
-
49Building off this, this piped command is quite handy (from another SO thread) `adb shell dumpsys activity | grep -i run` – loeschg Dec 03 '12 at 21:03
-
adb shell dumpsys activity | grep -i 'run' | grep -i 'com.example.package' – Gagandeep Singh Jan 08 '16 at 10:02
-
2is there a way to watch it live and not a snapshot? Things are happening too fast... – Nathan H Apr 06 '16 at 10:40
-
7@Nathan H - assuming you are on linux, you can use the watch command: `watch -n 1 "adb shell dumpsys activity | grep -i com.yourapp"` – Mr. Bungle May 31 '16 at 10:09
-
2
-
@VikasPandey The Terminal / Console. Wherever you would typically run `adb` commands. – Joshua Pinter Jul 04 '22 at 20:03