美文网首页
2020-05-21uiautomatorviewer获取不到手

2020-05-21uiautomatorviewer获取不到手

作者: 在暴风雨中逆袭 | 来源:发表于2020-05-21 11:37 被阅读0次

    Uiautomatorviewer报错:
    Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationTargetException

    android8以后sdk自带的uiautomator直接打开,截取不到机器界面信息。

    建议可以使用以下方法手动截取(来源:[http://www.luyixian.cn/news_show_228352.aspx]

    20190904112337887.png

    解决方法
    1.截取uix文件
    adb shell uiautomator dump /sdcard/sc.uix
    adb pull /sdcard/sc.uix
    注明:新手机地址改成:/data/local/tmp/**.uix
    2.截取截图
    adb shell screencap -p /sdcard/sc.png
    adb pull /sdcard/sc.png
    3.打开sdk tools目录下的uiautomatorviewer.bat,导入从机器获取的截图和资源文件


    image.png

    over!

    相关文章

      网友评论

          本文标题:2020-05-21uiautomatorviewer获取不到手

          本文链接:https://www.haomeiwen.com/subject/bqlzohtx.html