Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲

不錯的 Android 開源項目第四篇:開發與測試工具類

編輯:關於 Android 程式設計

本文整理 Android 生態中值得收藏的開源工具,聚焦在「開發」與「測試」兩大面向,涵蓋編譯加速、依賴管理、自動化測試、日誌檢視與資源生成等常見痛點。

1. Buck

Facebook 開源的 Android 編譯工具,官方宣稱效率約為 Ant 的兩倍。主要優勢:

(1) 透過平行利用多核心 CPU,並追蹤未變動的資源以縮短增量編譯時間;

(2) 可在編譯系統內直接生成編譯規則,無須額外維護規則檔;

(3) 編譯的同時產出單元測試結果;

(4) 同時適用於 IDE 編譯與持續整合流程;

(5) Facebook 持續優化中。

專案網址:https://github.com/facebook/buck

2. Android Maven Plugin

以 Maven 管理 Android 的三方依賴。Maven 在 Java EE 領域已是成熟的依賴管理方案,能統一控管版本與衝突。

專案網址:https://github.com/jayway/maven-android-plugin

3. Spoon

面向多機型的自動化測試工具,可把 App APK 與測試 APK 分發到不同裝置上執行,並彙整成測試報告。

專案網址:https://github.com/square/spoon

4. FEST for Android

提供一系列流暢的斷言 API,能顯著提升撰寫 Android 自測程式碼的效率與可讀性。

專案網址:https://github.com/square/fest-android

5. SelectorChapek for Android

Android Studio 外掛,可依固定命名規則的圖片資源,自動產生對應的 drawable selector XML。

專案網址:https://github.com/inmite/android-selector-chapek

6. Android Resource Navigator

Chrome 擴充功能,方便瀏覽 GitHub 上 Android 專案的 styles.xml 與 themes.xml。主要功能:

(1) 快速開啟 styles.xml / themes.xml;

(2) 資源之間可直接跳轉連結;

(3) 在網址列輸入 arn + Tab + 關鍵字即可搜尋 style 與 theme;

(4) 自動下載不同解析度的 drawable;

(5) 透過對照表查找不符合命名慣例的 style 與 theme。

專案網址:https://github.com/jgilfelt/android-resource-navigator

7. Android Action Bar Style Generator

線上選擇 ActionBar 樣式後,自動產生所需的圖片資源與 XML 設定檔,省去手繪九宮格圖的時間。

專案網址:https://github.com/jgilfelt/android-actionbarstylegenerator

線上展示:https://jgilfelt.github.io/android-actionbarstylegenerator/

8. ViewServer

嵌入後可讓 App 在任何裝置上都能用 HierarchyViewer 檢視檢視樹,對UI結構分析很有幫助。

專案網址:https://github.com/romainguy/ViewServer

9. GridWichterle for Android

在整個畫面上疊加網格線,用來檢查對齊與間距是否合規。可自訂網格大小與顏色,Android 設計規範建議使用 48dp 與 8dp 基線網格。

專案網址:https://github.com/inmite/android-grid-wichterle

APK:https://play.google.com/store/apps/details?id=eu.inmite.android.gridwichterle

備註:相較 HierarchyViewer 功能較為陽春,但作為快速的版面檢視輔助工具偶爾相當好用。

10. 渠道打包工具

用於一次產出多個渠道包,避免反覆手動修改設定。

專案網址:https://github.com/umeng/umeng-muti-channel-build-tool

另可參考 Google 新一代建置系統 Gradle:https://tools.android.com/tech-docs/new-build-system/user-guide

11. Catlog

手機端日誌檢視工具,支援多色標示、關鍵字過濾、等級過濾、程序 ID 過濾與錄製功能。

專案網址:https://github.com/nolanlawson/Catlog

12. PID Cat

依 package 名稱過濾 logcat 輸出,讓日誌不再被其他 App 洗版。

專案網址:https://github.com/JakeWharton/pidcat

13. Hugo

用於印出函式名稱與執行耗時,僅在 debug 模式下生效,是排查效能瓶頸的小幫手。

專案網址:https://github.com/JakeWharton/hugo

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © Android教程網 All Rights Reserved