android build server
TRANSCRIPT
![Page 1: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/1.jpg)
Others talk, We listen.
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
The Android Build Server
Antoine Campbell
![Page 2: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/2.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
2
• Background
• Inspiration (Google promised, GTAC 2013: Android Testing at Scale)
• Goals
• Approach (circa 2013)
• Pains
• Approach
• Demo
• Build Machine
• Questions
• Jenkins Setup Screenshots
Overview
![Page 3: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/3.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
3 Background
• UNC-Charlotte • B.A./M.S. Computer Science
• Android Developer • 2 client apps in prod, 4 supported
• iOS Developer • 1 enterprise app in prod
• Web Services (SOAP, REST)
• 2 client apps in prod
• Game Developer (former)
• CT native / NC native • CapTech Consulting – 3rd year
![Page 4: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/4.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
4
• Setup simple build server • Test Android apps
• API levels • Screen sizes • Languages
• Export screenshots • Gather test coverage • Gather sonar report • One-click-esqueness • Portable
Goals
![Page 5: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/5.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
5 Inspiration
![Page 6: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/6.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
6
• Ummm……so how do we get it? • Work at Google
Inspiration
![Page 7: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/7.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
7
• Jenkins • Multi-configuration Project • Build Matrix {API-Level}
• Ant
• Android Emulator Jenkins Plugin • Automatic emulator creation • Snapshots
• Robotium
• Emma Code Coverage
• UIAutomator
Approach (circa 2013)
![Page 8: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/8.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
8 Approach (circa 2013)
![Page 9: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/9.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
9
• Library projects • Setup local properties for all projects
• Android Emulator Jenkins Plugin • Incompatible combinations • Emulator unlocking not guaranteed
• Windows 7 PC – AMD Chipset • Limited emulator options
Pains
![Page 10: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/10.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
10
• Jenkins • Multi-configuration Project • Build Matrix {Emulator, Language}
• Gradle (Wrapper)
• Jacoco Code Coverage Jenkins Plugin • Android Emulator Jenkins Plugin
• Static Emulators (Disabled animations) • Espresso • Robotium
• Screenshots Only • Sonar • Not Windows
Approach
![Page 11: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/11.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
11
• Espresso • Older API levels may idle main thread before transitions
• Thread.sleep still needed on older API levels • Android Emulator Jenkins Plugin
• Still not guaranteed to unlock device • Fixed with shell commands to unlock device
• Android Gradle Plugin • Pure unit tests not a possibility • Next version will support!
More Pains
![Page 12: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/12.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
12
DEMO
Demo
![Page 13: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/13.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
13
• Lenovo ThinkServer TS140 (Core i3-4130 3.4GHz) - $269 • Dual core
• 16 GB ECC Ram - $169 • 256 GB SSD – Free (Thanks Larry) - ~$109
• CentOS 7 – Free • Total ~ $438
Build Machine
![Page 14: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/14.jpg)
Copyright © 2014 CapTech Ventures, Inc. All rights reserved.
14
• Multiple configurations running simultaneously • Automatic job creation for branching • Actually removing Thread.sleep from tests
• Google promised
• Complete test for home-screen widgets • UIAutomator
• MonkeyRunner tests • RoboElectric tests • Blog
What’s Next?
![Page 15: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/15.jpg)
15 Questions
Demo App: https://github.com/antoinecampbell/GithubUserBroswer Email: [email protected] Github: antoinecampbell Google+: [email protected] Twitter: N/A (coming soon……maybe) Blog: http://antoine-campbell.com Work Blog: http://www.captechconsulting.com/blog/antoine-campbell
![Page 16: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/16.jpg)
16 Jenkins Setup Screenshots – Jenkins Plugins
![Page 17: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/17.jpg)
17 Jenkins Setup Screenshots – Jenkins Plugins
![Page 18: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/18.jpg)
18 Jenkins Setup Screenshots – Jenkins Settings
![Page 19: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/19.jpg)
19 Jenkins Setup Screenshots – Jenkins Settings
![Page 20: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/20.jpg)
20 Jenkins Setup Screenshots – Config Matrix & Emulator
![Page 21: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/21.jpg)
21 Jenkins Setup Screenshots - Build
![Page 22: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/22.jpg)
22 Jenkins Setup Screenshots – Post Build
![Page 23: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/23.jpg)
23 Jenkins Setup Screenshots – Post Build
![Page 24: Android Build Server](https://reader030.vdocument.in/reader030/viewer/2022020101/55a699e61a28ab80668b45fe/html5/thumbnails/24.jpg)
24 Sonar Screenshots