Layout Inspector平替&跨平台结构分析器のAppium Inspector
引言因为我有一个api为26的设备,因为 Layout Inspector 无法在 API 26 以下设备上利用,而且如今AS的 Hierarchy Viewer 和Android Device Monitor 均已经在SDK中剔除,故想再搜一个pc版的结构查看器,发现Appium Inspector学习本钱较高,过程比较艰巨,没有好的中文教程,gtp复兴也不尽人意,故做下记载。
引路篇⭐⭐⭐⭐⭐
https://appium.github.io/appium-inspector/latest/quickstart/installation/
安装加启动
安装appium 而且下载驱动Android 和 UiAutomator2 如许环境就算预备好了
C:\Users\mmq>npm install -g appium
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated lodash.get@4.4.2: This package is deprecated. Use the optional chaining (?.) operator instead.
npm warn deprecated rimraf@2.4.5: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@6.0.4: Glob versions prior to v9 are no longer supported
changed 390 packages in 8s
61 packages are looking for funding
run `npm fund` for details
C:\Users\mmq>appium driver install uiautomator2
Error: × A driver named "uiautomator2" is already installed. Did you mean to update? Run "appium driver update". See installed drivers with "appium driver list --installed".
C:\Users\mmq>appium driver list --installed
√ Listing installed drivers
- uiautomator2@4.1.5
C:\Users\mmq>appium plugin install --source=npm appium-inspector-plugin
√ Checking if 'appium-inspector-plugin' is compatible
√ Installing 'appium-inspector-plugin'
Error: × A plugin named "inspector" is already installed. Did you mean to update? Run "appium plugin update". See installed plugins with "appium plugin list --installed".
C:\Users\mmq>appium --use-plugins=inspector --allow-cors
Attempting to load plugin inspector...
Requiring plugin at C:\Users\mmq\.appium\node_modules\appium-inspector-plugin\index.mjs
AppiumInspectorPlugin has been successfully loaded in 0.618s
Welcome to Appium v2.17.1
Non-default server args:
{
allowCors: true,
usePlugins: [
'inspector'
]
}
The autodetected Appium home path: C:\Users\mmq\.appium
Attempting to load driver uiautomator2...
Requiring driver at C:\Users\mmq\.appium\node_modules\appium-uiautomator2-driver\build\index.js
AndroidUiautomator2Driver has been successfully loaded in 0.860s
You have enabled CORS requests from any host. Be careful not to visit sites which could maliciously try to start Appium sessions on your machine
Appium REST http interface listener started on http://0.0.0.0:4723
You can provide the following URLs in your client code to connect to this server:
http://172.16.51.46:4723/
http://192.168.137.1:4723/
http://192.168.145.1:4723/
http://127.0.0.1:4723/ (only accessible from the same host)
http://172.28.240.1:4723/
Available drivers:
- uiautomator2@4.1.5 (automationName 'UiAutomator2')
Available plugins:
- inspector@2025.3.1 (ACTIVE)
杀历程
npm install --global kill-port
kill-port --port 4723
下载客户端
https://github.com/appium/appium-inspector/releases/download/v2024.9.1/Appium-Inspector-2024.9.1-win-x64.exe
利用客户端大概http://localhost:4723/inspector访问即可
配置项
https://i-blog.csdnimg.cn/direct/952a19f52e6c486abe62316a1d7cd770.png
运行
PC端结果
https://i-blog.csdnimg.cn/direct/3c27d197b59e4451b0dcae40b93e8135.png
web端结果
https://i-blog.csdnimg.cn/direct/b6d117f807234e219924f4cfad96cde0.png
配置贴一下
{
"platformName": "Android",
"appium:automationName": "UiAutomator2"
}
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]