Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

查看前台 Activity无效 #59

Closed
micstart opened this issue Nov 15, 2018 · 3 comments
Closed

查看前台 Activity无效 #59

micstart opened this issue Nov 15, 2018 · 3 comments

Comments

@micstart
Copy link

https://github.com/mzlogin/awesome-adb#%E6%9F%A5%E7%9C%8B%E5%89%8D%E5%8F%B0-activity
首选命令写的有问题,在window控制台中无法执行,需修改为:
adb shell "dumpsys activity activities | grep mFocusedActivity"
另外新的Android中dumpsys activity activities的输出中已经无法通过focuse关键字定位前台Activity了,可修改为:
adb shell "dumpsys activity activities | grep Run #"

@yuruiyin
Copy link

adb -d shell dumpsys activity activities | grep mResumedActivity
试试这个

@lrnrzg
Copy link

lrnrzg commented Aug 8, 2019

adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' --color=always

@mzlogin
Copy link
Owner

mzlogin commented Aug 11, 2019

大家的意见已经合入,谢谢!
我测试在 Android 7、8、9 上使用 mResumedActivity 都能行,然后 Windows 下使用 findstr 替代 grep,或者将 shell 命令部分用双引号括起来都可以。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants