Sdk mCurrentFocus和MFocuseApp未返回详细信息

Sdk mCurrentFocus和MFocuseApp未返回详细信息,sdk,appium,adb,avd,appium-android,Sdk,Appium,Adb,Avd,Appium Android,我希望使用Appium来建立一个UI自动化框架,但却遇到了第一个障碍。我知道有不同的方法可以检索appActivity和appPackage的详细信息,但我希望通过命令行尝试这种方法,以确保它们确实是我在设置功能时使用的正确的详细信息 这就引出了一个关于Appium的问题。当使用我当前的appPackage和appActivity详细信息启动新会话时,我无法自动启动应用程序,这是我使用真实设备通过apk详细信息应用程序获得的。-如有需要,我会将此作为单独问题提出 已设置指向sdk\平台工具的环境

我希望使用Appium来建立一个UI自动化框架,但却遇到了第一个障碍。我知道有不同的方法可以检索appActivity和appPackage的详细信息,但我希望通过命令行尝试这种方法,以确保它们确实是我在设置功能时使用的正确的详细信息

这就引出了一个关于Appium的问题。当使用我当前的appPackage和appActivity详细信息启动新会话时,我无法自动启动应用程序,这是我使用真实设备通过apk详细信息应用程序获得的。-如有需要,我会将此作为单独问题提出

已设置指向sdk\平台工具的环境变量。。。。运行这些命令时,应用程序在emulator上

我尝试了不同的方法来检索应用程序的详细信息,但都没有用。我已经列出了来自命令行的输入/输出

C:\windows\system32>adb devices
List of devices attached
emulator-5554   device


C:\windows\system32>adb shell
generic_x86:/ $ dumpsys window windows | grep -E 'mCurrentFocus'
1|generic_x86:/ $ dumpsys window windows | grep -E 'mCurrentFocus'
1|generic_x86:/ $ exit

C:\windows\system32>adb shell "dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'"

C:\windows\system32>adb shell "dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'"

C:\windows\system32>adb shell
generic_x86:/ $ dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
1|generic_x86:/ $ dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
1|generic_x86:/ $
任何帮助都将不胜感激:D

试试以下方法:

adb shell "dumpsys window | grep mCurrentFocus"

感谢命令dumpsys窗口| grep mCurrentFocus起作用。我能够看到当前的包和活动。 C:\Users\xxxx>adb外壳 1 |铍:/$dumpsys窗口| grep mCurrentFocus mCurrentFocus=Window{c941u12e u0 com.android.contacts/com.android.contacts.activities.TwelveKeyDialer}

最好使用ActivityRecord而不是mCurrentFocus 窗口: adb shell dumpsys窗口窗口| findstr ActivityRecord

Mac/Linux: adb shell dumpsys窗口窗口| grep活动记录


请在你的答案中添加更多的上下文。解释你在做什么以及为什么。