Skip to content

Instantly share code, notes, and snippets.

@j796160836
Created September 25, 2018 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save j796160836/e7b83b3f89a5592e4796e72b00015d7b to your computer and use it in GitHub Desktop.
Save j796160836/e7b83b3f89a5592e4796e72b00015d7b to your computer and use it in GitHub Desktop.
Get the top most activity from adb command
#!/bin/bash
devices=`adb devices | awk '{if(NR>1)print $1}'`
for device in $devices ; do
model=`adb -s $device shell getprop ro.product.model`
echo
echo '=== '$model' ('$device') ==='
adb -s $device shell dumpsys activity top | grep ACTIVITY
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment