Last active
November 8, 2016 09:01
-
-
Save wutianlong/e9274b389de763a6e4be096fd39943a5 to your computer and use it in GitHub Desktop.
This file contains 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