---
title: "第四部分 开发工具及测试工具"
author: "hsx9566"
date: "2014-08-20T15:35:45Z"
tags: ["开发工具", "测试工具"]
categories: ["移动开发"]
slug: "untitled"
draft: false
lastmod: "2014-08-20T15:42:12Z"
id: 2106422
url: "https://hsx9566.iteye.com/blog/2106422"
---

## 第四部分 开发工具及测试工具－内容来自互联网

主要介绍和Android开发工具和测试工具相关的开源项目。

#### [](https://github.com/Trinea/android-open-project#%E4%B8%80%E5%BC%80%E5%8F%91%E6%95%88%E7%8E%87%E5%B7%A5%E5%85%B7)一、开发效率工具

01. Parceler  
    通过注解及工具类自动完成实体类 Parcelable及值传递 项目地址：[https://github.com/johncarl81/parceler](https://github.com/johncarl81/parceler)
02. Json2Java  
    根据JSon数据自动生成对应的Java实体类，还支持Parcel、Gson Annotations对应代码自动生成。期待后续的提取父类以及多url构建整个工程的功能  
    项目地址：[https://github.com/jonfhancock/JsonToJava](https://github.com/jonfhancock/JsonToJava)  
    在线演示：[http://jsontojava.appspot.com/](http://jsontojava.appspot.com/)
03. IntelliJ Plugin for Android Parcelable boilerplate code generation  
    Android studio插件，生成Parcelable代码  
    项目地址：[https://github.com/mcharmas/android-parcelable-intellij-plugin](https://github.com/mcharmas/android-parcelable-intellij-plugin)  
    效果图：[![Holo Colors Idea](https://github.com/mcharmas/android-parcelable-intellij-plugin/raw/master/screenshot.png)](https://github.com/mcharmas/android-parcelable-intellij-plugin/raw/master/screenshot.png)
04. Android Holo Colors IntelliJ Plugin  
    Android studio插件，生成holo样式9 patch图片  
    项目地址：[https://github.com/jeromevdl/android-holo-colors-idea-plugin](https://github.com/jeromevdl/android-holo-colors-idea-plugin)  
    效果图：[![Holo Colors Idea](https://camo.githubusercontent.com/c8b23e6a546e50717b079991ce2cad42171c97a6/68747470733a2f2f7261772e6769746875622e636f6d2f6a65726f6d6576646c2f616e64726f69642d686f6c6f2d636f6c6f72732d696465612d706c7567696e2f6d61737465722f6f746865722f686f6c6f636f6c6f7273696465612e706e67)](https://camo.githubusercontent.com/c8b23e6a546e50717b079991ce2cad42171c97a6/68747470733a2f2f7261772e6769746875622e636f6d2f6a65726f6d6576646c2f616e64726f69642d686f6c6f2d636f6c6f72732d696465612d706c7567696e2f6d61737465722f6f746865722f686f6c6f636f6c6f7273696465612e706e67)
05. Android Drawable Factory  
    用于生成各个分辨率的图片  
    项目地址：[https://github.com/tizionario/AndroidDrawableFactory](https://github.com/tizionario/AndroidDrawableFactory)  
    效果图：[![Android Drawable Factory](https://camo.githubusercontent.com/11357fe470c930fe8c596d172d8324020622e06c/68747470733a2f2f6769746875622d63616d6f2e676c6f62616c2e73736c2e666173746c792e6e65742f356333383434623334356139373739323936663939363439303037306461623062666339646266352f3638373437343730373333613266326636343663326536343732366637303632366637383735373336353732363336663665373436353665373432653633366636643266373532663332333633363336333433363337333532663431366536343732366636393634343437323631373736313632366336353436363136333734366637323739326633313265373036653637)](https://camo.githubusercontent.com/11357fe470c930fe8c596d172d8324020622e06c/68747470733a2f2f6769746875622d63616d6f2e676c6f62616c2e73736c2e666173746c792e6e65742f356333383434623334356139373739323936663939363439303037306461623062666339646266352f3638373437343730373333613266326636343663326536343732366637303632366637383735373336353732363336663665373436353665373432653633366636643266373532663332333633363336333433363337333532663431366536343732366636393634343437323631373736313632366336353436363136333734366637323739326633313265373036653637)
06. SelectorChapek for Android  
    Android Studio插件，可根据固定文件名格式资源自动生成drawable selectors xml文件。  
    项目地址：[https://github.com/inmite/android-selector-chapek](https://github.com/inmite/android-selector-chapek)
07. Android Action Bar Style Generator  
    Android ActionBar样式生成器，可在线选择ActionBar样式自动生成所需要的图片资源及xml文件  
    项目地址：[https://github.com/jgilfelt/android-actionbarstylegenerator](https://github.com/jgilfelt/android-actionbarstylegenerator)  
    在线演示：[http://jgilfelt.github.io/android-actionbarstylegenerator/](http://jgilfelt.github.io/android-actionbarstylegenerator/)
08. ButterKnifeZelezny  
    用于快速生成[ButterKnife](https://github.com/JakeWharton/butterknife)View注入代码的Android Studio/IDEA插件  
    项目地址：[https://github.com/inmite/android-butterknife-zelezny](https://github.com/inmite/android-butterknife-zelezny)
09. RoboCoP  
    利用Gradle task根据固定格式的json文件生成ContentProvider  
    项目地址：[https://github.com/mediarain/RoboCoP](https://github.com/mediarain/RoboCoP)
10. appiconsizes  
    用于生成各个分辨率的图片  
    项目地址：[http://www.appiconsizes.com/](http://www.appiconsizes.com/)
11. Gradle Retrolambda Plugin  
    [Retrolambda](https://github.com/orfjackal/retrolambda)是将Java8的Lambdas应用于Java7的工具，本项目是Gradle插件，通过Retrolambda从而使Java或Android项目用Java8的Lambdas编写，将编译后的字节码转换为Java6和7的字节码从而正常运行  
    项目地址：[https://github.com/evant/gradle-retrolambda](https://github.com/evant/gradle-retrolambda)
12. Dagger IntelliJ Plugin  
    dagger的intellij插件  
    项目地址：[https://github.com/square/dagger-intellij-plugin](https://github.com/square/dagger-intellij-plugin)
13. Android Gen Drawable Maven plugin  
    在编译时根据SVG描述文件生成不同分辨率的jpg、png或点9图片  
    项目地址：[https://github.com/avianey/androidgendrawable-maven-plugin](https://github.com/avianey/androidgendrawable-maven-plugin)
14. Android Asset Studio  
    各种Android资源自动生成器，包括启动图标、ActionBar图标、通知栏图标、点9等  
    项目地址：[https://github.com/romannurik/AndroidAssetStudio](https://github.com/romannurik/AndroidAssetStudio)  
    在线演示：[http://romannurik.github.io/AndroidAssetStudio/](http://romannurik.github.io/AndroidAssetStudio/)  
    [![](https://camo.githubusercontent.com/01a7b0f6a5751ece650a2658c342f5b4bd84db1e/687474703a2f2f6661726d342e737461746963666c69636b722e636f6d2f333733372f31323136373431333133345f656463666636386532325f6f2e706e67)](https://github.com/Trinea/android-open-project#%E7%9B%AE%E5%89%8D%E5%8C%85%E6%8B%AC "返回目录")

#### [](https://github.com/Trinea/android-open-project#%E4%BA%8C%E5%BC%80%E5%8F%91%E8%87%AA%E6%B5%8B%E7%9B%B8%E5%85%B3)二、开发自测相关

1. Quality Tools for Android  
   Android测试及自测工具集合和示例  
   项目地址：[https://github.com/stephanenicolas/Quality-Tools-for-Android](https://github.com/stephanenicolas/Quality-Tools-for-Android)
2. android-test-kit  
   Google的Android测试工具  
   包括GoogleInstrumentationTestRunner(增强版的InstrumentationTestRunner)和Espresso(用于快速写出可靠测试用例的API)  
   项目地址：[https://code.google.com/p/android-test-kit/](https://code.google.com/p/android-test-kit/)  
   文档介绍：[https://code.google.com/p/android-test-kit/w/list](https://code.google.com/p/android-test-kit/w/list)
3. robolectric  
   测试用例编写框架  
   项目地址：[https://github.com/robolectric/robolectric](https://github.com/robolectric/robolectric)  
   Demo地址：[https://github.com/robolectric/robolectricsample](https://github.com/robolectric/robolectricsample)  
   文档介绍：[http://robolectric.org/](http://robolectric.org/)  
   特点：(1). 不需要模拟器在一般JVM就可以运行测试用例  
   (2). 能完成在真机上的大部分测试包括感应器  
   其他的测试用例及相关模块Mock可见：[android-mock](https://code.google.com/p/android-mock/), [mockito](https://code.google.com/p/mockito/), [easy-mock](https://github.com/easymock/easymock)
4. Android FEST  
   提供一些列方便的断言，可用于提高编写Android自测代码效率  
   项目地址：[https://github.com/square/fest-android](https://github.com/square/fest-android)
5. BoundBox  
   可用于测试类各种访问权限的属性、方法。实际是通过BoundBox这个annotation生成一个属性和方法都是public权限的中间类并对此类进行测试完成的  
   项目地址：[https://github.com/stephanenicolas/boundbox](https://github.com/stephanenicolas/boundbox)
6. Hugo  
   用于打印函数信息及执行时间的工具，仅在debug模式生效  
   项目地址：[https://github.com/JakeWharton/hugo](https://github.com/JakeWharton/hugo)
7. scalpel  
   在应用下面添加一层用于界面调试，待详细补充 // TODO  
   项目地址：[https://github.com/JakeWharton/scalpel](https://github.com/JakeWharton/scalpel)
8. Android Screenshot library  
   Android截图工具类，用于在持续集成时截图  
   项目地址：[https://github.com/rtyley/android-screenshot-lib](https://github.com/rtyley/android-screenshot-lib)
9. sonar-android-lint-plugin  
   将android lint的错误在sonar中展现  
   项目地址：[https://github.com/SonarCommunity/sonar-android](https://github.com/SonarCommunity/sonar-android)  
   [![](https://camo.githubusercontent.com/01a7b0f6a5751ece650a2658c342f5b4bd84db1e/687474703a2f2f6661726d342e737461746963666c69636b722e636f6d2f333733372f31323136373431333133345f656463666636386532325f6f2e706e67)](https://github.com/Trinea/android-open-project#%E7%9B%AE%E5%89%8D%E5%8C%85%E6%8B%AC "返回目录")

#### [](https://github.com/Trinea/android-open-project#%E4%B8%89%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7)三、测试工具

1. Spoon  
   可用于android不同机型设备自动化测试，能将应用apk和测试apk运行在不同机器上并生成相应测试报告。  
   项目地址：[https://github.com/square/spoon](https://github.com/square/spoon)
2. Tencent APT  
   APT是腾讯开源的一个Android平台高效性能测试组件，提供丰富实用的功能，适用于开发自测、定位性能瓶颈；测试人员完成性能基准测试、竞品对比测试  
   项目地址：[https://github.com/stormzhang/APT](https://github.com/stormzhang/APT)
3. Emmagee  
   网易开源的性能测试工具，包括CPU、内存、网络流量、启动时间、电池状态等  
   项目地址：[https://github.com/NetEase/Emmagee](https://github.com/NetEase/Emmagee)
4. Android py-uiautomator  
   py-uiautomator是一个对Android uiautomator用python进行封装的测试框架.  
   项目地址：[https://github.com/xiaocong/uiautomator](https://github.com/xiaocong/uiautomator)  
   [![](https://camo.githubusercontent.com/01a7b0f6a5751ece650a2658c342f5b4bd84db1e/687474703a2f2f6661726d342e737461746963666c69636b722e636f6d2f333733372f31323136373431333133345f656463666636386532325f6f2e706e67)](https://github.com/Trinea/android-open-project#%E7%9B%AE%E5%89%8D%E5%8C%85%E6%8B%AC "返回目录")

#### [](https://github.com/Trinea/android-open-project#%E5%9B%9B%E5%BC%80%E5%8F%91%E5%8F%8A%E7%BC%96%E8%AF%91%E7%8E%AF%E5%A2%83)四、开发及编译环境

1. Buck  
   facebook开源的Android编译工具，效率是ant的两倍。主要优点在于：  
   (1) 加快编译速度，通过并行利用多核cpu和跟踪不变资源减少增量编译时间实现  
   (2) 可以在编译系统中生成编译规则而无须另外的系统生成编译规则文件  
   (3) 编译同时可生成单元测试结果  
   (4) 既可用于IDE编译也可用于持续集成编译  
   (5) facebook持续优化中  
   项目地址：[https://github.com/facebook/buck](https://github.com/facebook/buck)
2. Android Maven Plugin  
   Android Maven插件，可用于对android三方依赖进行管理。在J2EE开发中，maven是非常成熟的依赖库管理工具，可统一管理依赖库。  
   项目地址：[https://github.com/jayway/maven-android-plugin](https://github.com/jayway/maven-android-plugin)
3. umeng-muti-channel-build-tool  
   渠道打包工具  
   项目地址：[https://github.com/umeng/umeng-muti-channel-build-tool](https://github.com/umeng/umeng-muti-channel-build-tool)  
   另可参见Google的构建系统Gradle：[http://tools.android.com/tech-docs/new-build-system/user-guide](http://tools.android.com/tech-docs/new-build-system/user-guide)
4. Genymotion  
   目前最好用最快的android模拟器  
   项目地址：[http://www.genymotion.com/](http://www.genymotion.com/)  
   Android studio集成控件： [http://plugins.jetbrains.com/plugin/7269?pr=idea](http://plugins.jetbrains.com/plugin/7269?pr=idea)  
   Cyril Mottier推荐：[http://cyrilmottier.com/2013/06/27/a-productive-android-development-environment/](http://cyrilmottier.com/2013/06/27/a-productive-android-development-environment/)
5. gradle-mvn-push  
   方便的将Gradle的Artifacts上传到Maven仓库  
   项目地址：[https://github.com/chrisbanes/gradle-mvn-push](https://github.com/chrisbanes/gradle-mvn-push)  
   文档介绍：[https://github.com/chrisbanes/gradle-mvn-push#usage](https://github.com/chrisbanes/gradle-mvn-push#usage)
6. Android Emulator Plugin for Jenkins  
   Android模拟器 jenkins插件，用于Jenkins做持续集成时跑模拟器测试  
   项目地址：[https://github.com/jenkinsci/android-emulator-plugin](https://github.com/jenkinsci/android-emulator-plugin)
7. Android Maven Plugin  
   管理应用所需要的依赖库。包括的构建工具有Maven、Gradle、ant、sbt  
   项目地址：[https://github.com/mosabua/maven-android-sdk-deployer](https://github.com/mosabua/maven-android-sdk-deployer)
8. SDK Manager Plugin  
   下载和管理Android SDK的Gradle插件  
   项目地址：[https://github.com/JakeWharton/sdk-manager-plugin](https://github.com/JakeWharton/sdk-manager-plugin)
9. Gradle Protobuf Plugin  
   将.proto文件转换成Java文件的gradle插件  
   项目地址：[https://github.com/andrewkroh/gradle-protobuf-plugin](https://github.com/andrewkroh/gradle-protobuf-plugin)  
   [![](https://camo.githubusercontent.com/01a7b0f6a5751ece650a2658c342f5b4bd84db1e/687474703a2f2f6661726d342e737461746963666c69636b722e636f6d2f333733372f31323136373431333133345f656463666636386532325f6f2e706e67)](https://github.com/Trinea/android-open-project#%E7%9B%AE%E5%89%8D%E5%8C%85%E6%8B%AC "返回目录")

#### [](https://github.com/Trinea/android-open-project#%E4%BA%94%E5%85%B6%E4%BB%96)五、其他

01. ViewServer  
    允许app运行在任何手机上都可以用HierarchyViewer查看  
    项目地址：[https://github.com/romainguy/ViewServer](https://github.com/romainguy/ViewServer)
02. GridWichterle for Android  
    在整个系统上显示一个grid，用来帮助查看应用布局及使得布局更美观，可设置grid网格大小和颜色，android推荐48dp和8dp，可见 Android Design Guidelines – Metrics and Grids  
    项目地址：[https://github.com/inmite/android-grid-wichterle](https://github.com/inmite/android-grid-wichterle)  
    APK地址：[https://play.google.com/store/apps/details?id=eu.inmite.android.gridwichterle](https://play.google.com/store/apps/details?id=eu.inmite.android.gridwichterle)  
    PS：比起hierarchyviewer相差甚远，不过偶尔可用来作为布局查看工具。
03. Catlog  
    手机端log查看工具，支持不同颜色显示、关键字过滤、级别过滤、进程id过滤、录制功能等  
    项目地址：[https://github.com/nolanlawson/Catlog](https://github.com/nolanlawson/Catlog)  
    在线演示：[https://play.google.com/store/apps/details?id=com.nolanlawson.logcat](https://play.google.com/store/apps/details?id=com.nolanlawson.logcat)
04. PID Cat  
    根据package查看logcat日志  
    项目地址：[https://github.com/JakeWharton/pidcat](https://github.com/JakeWharton/pidcat)
05. ACRA  
    应用崩溃信息上报到GoogleDoc工具，网页版展现结果三方开源地址[https://github.com/BenoitDuffez/crashreportsviewer](https://github.com/BenoitDuffez/crashreportsviewer)  
    项目地址：[https://github.com/ACRA/acra](https://github.com/ACRA/acra)  
    文档地址：[https://github.com/ACRA/acra/wiki/BasicSetup](https://github.com/ACRA/acra/wiki/BasicSetup)
06. Crashlytics  
    提供丰富的应用崩溃信息收集  
    轻量级，丰富，可自定义应用崩溃信息收集器，附有邮件通知  
    项目地址：[http://www.crashlytics.com/](http://www.crashlytics.com/)  
    集成插件：[Android Studio, Eclipse and IntelliJ](http://try.crashlytics.com/sdk-android/?utm_source=blog&utm_medium=blog&utm_campaign=Announcing_android_studio_wp&utm_content=CTA_button)
07. Android Resource Navigator  
    chrome插件，可以方便的查看github上android源码工程的styles.xml和themes.xml。主要功能：  
    (1) 快速打开android styles.xml themes.xml  
    (2) 方便在资源间跳转。styles.xml themes.xml文件中资源链接跳转，可以方便跳转到某个资源  
    (3) 方便查找某个style和theme。chrome地址栏输入arn+tab+搜索内容回车即可  
    (4) 自动下载不同分辨率下的drawable  
    (5) 通过映射查找那些不是按照固定命名规则命名的style和theme  
    项目地址：[https://github.com/jgilfelt/android-resource-navigator](https://github.com/jgilfelt/android-resource-navigator)  
    在线演示：[https://chrome.google.com/webstore/detail/android-resource-navigato/agoomkionjjbejegcejiefodgbckeebo?hl=en&gl=GB](https://chrome.google.com/webstore/detail/android-resource-navigato/agoomkionjjbejegcejiefodgbckeebo?hl=en&gl=GB)
08. android-resource-remover  
    根据lint的提示删除项目中无用的资源，减少包的大小  
    项目地址：[https://github.com/KeepSafe/android-resource-remover](https://github.com/KeepSafe/android-resource-remover)
09. Telescope  
    通过手势截图以特定主题发送到特定邮箱地址报告Bug  
    项目地址：[https://github.com/mattprecious/telescope](https://github.com/mattprecious/telescope)
10. Complete Android Fragment & Activity Lifecycle  
    完整的Android Fragment/Activity生命周期图  
    项目地址：[https://github.com/xxv/android-lifecycle](https://github.com/xxv/android-lifecycle)