美文网首页Android
Android查看UI布局相关工具

Android查看UI布局相关工具

作者: tinyvampirepudg | 来源:发表于2022-03-05 08:44 被阅读0次

1、uiautomatorviewer: android-sdk自带。

需要android开发环境。手机上打开对应页面,在终端输入uiautomatorviewer即可。

Write automated tests with UI Automator

2、Android Studio中的LayoutInspector:IDE带的,可以实时查看布局层级信息。

通过adb连接上手机,然后在Android Studio中打开LayoutInspector,即可查看手机上的实时布局信息。
如果页面复杂,会卡顿。

Layout Inspector

3、stecho: facebook的开源库,可以在浏览器中查看布局信息。

在项目中依赖stetho三方库,运行到手机上之后,在浏览器中可查看。

stetho

4、dumpsys

通过adb shell dumpsys activity top命令,拿到当前activity的快照,内部包含布局信息。
最稳定、靠谱。

dumpsys

推荐第4种。

相关文章

网友评论

    本文标题:Android查看UI布局相关工具

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