【问题标题】:dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' command is not returning the valuesdumpsys 窗口窗口| grep -E 'mCurrentFocus|mFocusedApp' 命令未返回值
【发布时间】:2017-04-03 07:16:43
【问题描述】:

我已经连接了一个真实的设备并在上面打开了应用程序。但是如果我在 cmd 中键入以下命令

dumpsys 窗口窗口 | grep -E 'mCurrentFocus|mFocusedApp'

我得到以下错误'dumpsys' is not recognized as an internal or external command, operable program or batch file.

虽然我之前能够为同一个应用程序使用相同的命令获取主活动和包活动。请帮助我找出我可能输入错误或需要进行任何其他更改

【问题讨论】:

  • 如果您可以添加设备型号和您所使用的固件版本会更有帮助,以便人们知道他们需要回答什么以及如何重现问题

标签: android windows


【解决方案1】:

dumpsys 是一个 shell 命令。您可以从命令行运行它,如下所示:

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

如果你连接了多个设备,首先通过执行获取它们的 ID:

adb devices

然后,将<your-device-id> 替换为相关的设备ID:

adb -s <your-device-id> shell dumpsys window windows | grep -E 'mCurrentFocus | mFocusedApp'

【讨论】:

    猜你喜欢
    • 2020-04-11
    • 2017-10-30
    • 1970-01-01
    • 2020-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多