uiautomatorviewer Error obtaining UI hierarchy

今天遇到使用sdk中的uiautomatorviewer获取手机元素时,居然提示Error obtaining UI hierarchy,最后解决方案是,把下面的代码放到bat脚本中,运行一次就可以了:

call adb shell uiautomator dumpcall 
call adb pull /storage/sdcard/window_dump.xml .
call window_dump.xml

你可能感兴趣的:(uiautomatorviewer Error obtaining UI hierarchy)