-
-
Save flyfire/3cd13e84d90df5924379d72b98dd7ff5 to your computer and use it in GitHub Desktop.
A shell script log the current android top activity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oldActvity="" | |
displayName="" | |
currentActivity=`adb shell dumpsys window windows | grep -E 'mCurrentFocus'` | |
while true | |
do | |
if [[ $oldActvity != $currentActivity && $currentActivity != *"=null"* ]]; then | |
displayName=${currentActivity##* } | |
displayName=${displayName%%\}*} | |
echo $displayName | |
oldActvity=$currentActivity | |
fi | |
currentActivity=`adb shell dumpsys window windows | grep -E 'mCurrentFocus'` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment