appium自动化---activity获取

方法一:appt查询activity获取

aapt dump badging <路径/包名> | find "launchable-activity"

 

方法二:

  1.打开app的同时输入以下其中一条:

windows使用:
  adb shell dumpsys window w |findstr \/ |findstr name=
  adb shell dumpsys window |findstr mCurrent
  adb shell dumpsys activity | findstr "mFocusedActivity"
苹果电脑使用方法:
  adb shell dumpsys activity | grep "mFocusedActivity"

 

总结:两个方法相比,方法一更加简单,不用启动app即可,并且稳定100%能找到。方法二使用过程中需要启动app,再执行命令。过程中方法二不一定能找到activity,所以我写了多个命令【感觉方法二靠运气一样】。

posted @ 2019-04-16 22:57  占卜者  阅读(982)  评论(0编辑  收藏  举报