釋出 UIAutomatorViewer 獨立包開源工程專案

cmlanche發表於2020-10-10

專案地址

https://github.com/cmlanche/uiautomatorviewer-standalone

說明

我們在編寫指令碼時,如寫Appium指令碼,經常需要檢視介面控制元件資訊,會用到UIAutomatorViewer,而使用這個工具,我們需要去下載Android SDK,對於不擅長技術的業務測試來說,下載Android SDK都是一件麻煩事,為了減輕痛苦,我釋出了此獨立包專案工程。
這個工程是谷歌官方UIAutomatorViewer改造而來,用來抓取UIAutomator控制元件的工具,支援獨立執行,但因為其依賴於swt,所以需要在mac和windows下分別編譯。

打包

mvn clean package

啟動

mac下:

java -XstartOnFirstThread -jar uiautomatorviewer-standalone-1.0-SNAPSHOT-all.jar

windows下:

java -jar uiautomatorviewer-standalone-1.0-SNAPSHOT-all.jar

原始碼來源

原始碼來自谷歌官方

查閱依賴後找到相關庫:

  1. swt:https://download.eclipse.org/eclipse/downloads/drops4/I20200830-1800/#SWT
  2. jface: 下載RCP Runtime Binary,解壓後查詢org.eclipse.core.commands_{version}.jar、org.eclipse.equinox.common_{version}.jar、org.eclipse.jface_{version}.jar
  3. 額外還包括其他依賴: xml <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.7</version> </dependency>

預覽

UIAutomatorViewer

相關文章