SlideShare a Scribd company logo
1 of 38
Download to read offline
Tips for better CI on
Android
Tomoaki Imai @Potatotips #22 2015/10/13
Hi I’m Tomo(今井智章)
Hi I’m Tomo(今井智章)
Hi I’m Tomo(今井智章)
Hi I’m Tomo(今井智章)
Hi I’m Tomo(今井智章)
Continuous Integration
on Android
1. How do we CI on Android
2. 4 tips for better CI
1. How do we CI on Android
2. 4 tips for better CI
How do we CI Mercari
Android App?
CI for Mercari Android App
• Started April 2015
• Purpose
- Build Check each
Flavour and BuildType
- Automate app tests
- Continuous deployment
Phase 1: Travis CI
Good!!
• Easy setup with yml
• Build production app without
including secret keys into the
repo(http://docs.travis-ci.com/user/encrypting-
files/)
• Most of Mercari project
run CI on Travis CI
So-so…
• Need some tweaks to avoid Out of Memory
• Slow. Takes 12-15min/per build check
Phase 2: circleCI
Good!!
• Has better features for testing and debugging
• Bit faster than Travis CI (1- 2min for each build)
• Mercari iOS project runs CI on CircleCI
So-so…
• Need some tweaks to avoid Out of Memory
• Building production app looked a bit tricky
(Haven’t tried yet)
Both CI service have good
parts…
Why not use both?
Phase 3: Travis CI & circleCI
Check Production App
Check Development App
Run JUnit Tests
Deploy
Let each CI service do different tasks
Total CI Running time reduced
to 8-7 min(about 2x shorter)
1. How do we CI on Android
2. 4 tips for better CI
Tip 1: Avoid OOM(CircleCI)
• 4GB memory limit
Tip 1: Avoid OOM(CircleCI)
• 4GB memory limit
Tip 1: Avoid OOM(CircleCI)
https://circleci.com/docs/oom
but was in vain…
Guide for 4GB limit
Check memory_usage.txt
PID RSS %CPU COMMAND
21787 2250024 165 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xmx4g -
Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /usr/
local/android-sdk-linux/build-tools/21.1.1/lib/dx.jar com.android.dx.command.Main --
dex --force-jumbo --output /home/ubuntu/mercari-android-as/app/build/intermediates/
dex/us/dev /home/ubuntu/mercari-android-as/app/build/intermediates/classes-proguard/
us/dev/classes.jar
9477 1628300 104 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -XX:
+HeapDumpOnOutOfMemoryError -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -
Duser.language=en -Duser.variant -cp /home/ubuntu/.gradle/wrapper/dists/gradle-2.2.1-
all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1/lib/gradle-launcher-2.2.1.jar
org.gradle.launcher.daemon.bootstrap.GradleDaemon 2.2.1 /home/ubuntu/.gradle/daemon
10800000 b3531fa1-fad3-4599-a284-96a81cc9336b -XX:+HeapDumpOnOutOfMemoryError -
Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant
9145 279164 4.7 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xms256m -Xmx512m -
Dorg.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -
Dorg.gradle.appname=gradlew -classpath /home/ubuntu/mercari-android-as/gradle/wrapper/
gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain assembleDev -PdisablePreDex
Tip 1: Avoid OOM(CircleCI)
PID RSS %CPU COMMAND
21787 2250024 165 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xmx4g -
Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /usr/
local/android-sdk-linux/build-tools/21.1.1/lib/dx.jar com.android.dx.command.Main --
dex --force-jumbo --output /home/ubuntu/mercari-android-as/app/build/intermediates/
dex/us/dev /home/ubuntu/mercari-android-as/app/build/intermediates/classes-proguard/
us/dev/classes.jar
9477 1628300 104 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -XX:
+HeapDumpOnOutOfMemoryError -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -
Duser.language=en -Duser.variant -cp /home/ubuntu/.gradle/wrapper/dists/gradle-2.2.1-
all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1/lib/gradle-launcher-2.2.1.jar
org.gradle.launcher.daemon.bootstrap.GradleDaemon 2.2.1 /home/ubuntu/.gradle/daemon
10800000 b3531fa1-fad3-4599-a284-96a81cc9336b -XX:+HeapDumpOnOutOfMemoryError -
Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant
9145 279164 4.7 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xms256m -Xmx512m -
Dorg.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -
Dorg.gradle.appname=gradlew -classpath /home/ubuntu/mercari-android-as/gradle/wrapper/
gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain assembleDev -PdisablePreDex
Tip 1: Avoid OOM(CircleCI)
JVM is using too much memory!
2250024 + 1628300 + 279164 = 4157488KB ≒4GB
PID RSS %CPU COMMAND
21787 2250024 165 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xmx4g -
Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /usr/
local/android-sdk-linux/build-tools/21.1.1/lib/dx.jar com.android.dx.command.Main --
dex --force-jumbo --output /home/ubuntu/mercari-android-as/app/build/intermediates/
dex/us/dev /home/ubuntu/mercari-android-as/app/build/intermediates/classes-proguard/
us/dev/classes.jar
9477 1628300 104 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -XX:
+HeapDumpOnOutOfMemoryError -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -
Duser.language=en -Duser.variant -cp /home/ubuntu/.gradle/wrapper/dists/gradle-2.2.1-
all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1/lib/gradle-launcher-2.2.1.jar
org.gradle.launcher.daemon.bootstrap.GradleDaemon 2.2.1 /home/ubuntu/.gradle/daemon
10800000 b3531fa1-fad3-4599-a284-96a81cc9336b -XX:+HeapDumpOnOutOfMemoryError -
Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant
9145 279164 4.7 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xms256m -Xmx512m -
Dorg.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -
Dorg.gradle.appname=gradlew -classpath /home/ubuntu/mercari-android-as/gradle/wrapper/
gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain assembleDev -PdisablePreDex
Tip 1: Avoid OOM(CircleCI)
Progard + Gradle consumes memory a lot
Tip 1: Avoid OOM(CircleCI)
Tuning tips:
• Lower the total memory(JVM,Gradle) size to 4.0G
• Adjust Xmx and MaxPermSize
• Set timeout (>1000) for GC
Xmx -> Heap space (where object resources are allocated )
MaxPermSize -> Permgen(where class, methods are loaded)
Tip 1: Avoid OOM(CircleCI)
machine:

environment:

ANDROID_HOME: /usr/local/android-sdk-linux

_JAVA_OPTIONS: "-Xms256m -Xmx1280m -XX:MaxPermSize=350m"

GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1536m -
XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError"'
…
override:

- ./gradlew assembleDev -PdisablePreDex:

timeout: 1500
Heap Perm Heap Perm other
JVM(dex) Gradle
4GB
• There is no best practice but I suggest that
large memory be allocated to Xmx
Tip 2: Save the JUnit test result(CircleCI)
test:

post:

- mkdir -p $CIRCLE_TEST_REPORTS/junit/

- find . -type f -regex ".*/test-results/*/.*xml" -exec cp {}
$CIRCLE_TEST_REPORTS/junit/ ;
• You can check Test result from ‘Test Failure’
http://qiita.com/tomoima525/items/b4a91d1624aaf0112b3f
Ref. CircleCIでJUnitの結果を見る
Tip 3: Continuous deployment for specific
branches(CircleCI)
• Run shell script for specific branches
deployment:

jp:

branch: [/deploy_jp_.*/, /release_.*/]

commands:

- ./deploy_jp.sh $CIRCLE_BRANCH

us:

branch: [/deploy_us_.*/, /release_.*/]

commands:

- ./deploy_us.sh $CIRCLE_BRANCH
RELEASE_MESSAGE=$1
#deploy

curl -F "file=@app/apk/mercari_dev_jp.apk" -F "token=$
{DEPLOY_GATE_API_KEY}" -F "message=${RELEASE_MESSAGE}" -F
"distribution_key=${JP_DEV_DIST_KEY}" -F "release_note=$
{RELEASE_MESSAGE}" https://deploygate.com/api/users/xxxx/apps
deploy_jp.sh
Tip 3: Continuous deployment for specific
branches(CircleCI)
• Set variables at `Environment variables`
Tip 4: Add dependencies manually
dependencies:
override:
- echo y | android update sdk --no-ui --all --filter extra-
google-m2repository,extra-android-m2repository,build-tools-23.0.1,
android-23
android:
components:
- build-tools-23.0.1
- android-23
- extra-android-m2repository
- extra-google-m2repository
.travis.yml
circle.yml
• The latest packages(ex. Android M) are not installed on
the VM
• Add manually with command line
• Tip 1: Check memory usage of JVM to
avoid OOM
• Tip 2: Save the JUnit test result on the VM
• Tip 3: Continuous deployment for specific
branches
• Tip 4: Add dependencies manually
Try it out for your project!

More Related Content

What's hot

No more waiting for API - Android Stub Server
No more waiting for API - Android Stub ServerNo more waiting for API - Android Stub Server
No more waiting for API - Android Stub ServerSylwester Madej
 
DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學謝 宗穎
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合Carl Su
 
No more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola SolutionsNo more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola SolutionsDroidConTLV
 
Trunk-Based Development
Trunk-Based DevelopmentTrunk-Based Development
Trunk-Based DevelopmentBryan Liu
 
Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetupSyam Sasi
 
Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.UA Mobile
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golangBo-Yi Wu
 
Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!Michał Ćmil
 
Getting started with docker
Getting started with dockerGetting started with docker
Getting started with dockerSaim Safder
 
Fastlane on Android 介紹
Fastlane on Android 介紹Fastlane on Android 介紹
Fastlane on Android 介紹Kros Huang
 
Eclipse RCP Demo
Eclipse RCP DemoEclipse RCP Demo
Eclipse RCP DemoCsaba Toth
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.UA Mobile
 
Eclipse Buildship JUG Hamburg
Eclipse Buildship JUG HamburgEclipse Buildship JUG Hamburg
Eclipse Buildship JUG Hamburgsimonscholz
 
Continuous integration in games development
Continuous integration in games developmentContinuous integration in games development
Continuous integration in games developmentNebojsa Brindic
 
iOS Automation with Cucumber, Appium and Saucelabs
iOS Automation with Cucumber, Appium and SaucelabsiOS Automation with Cucumber, Appium and Saucelabs
iOS Automation with Cucumber, Appium and SaucelabsShashikant Jagtap
 

What's hot (20)

No more waiting for API - Android Stub Server
No more waiting for API - Android Stub ServerNo more waiting for API - Android Stub Server
No more waiting for API - Android Stub Server
 
Build Automation in Android
Build Automation in AndroidBuild Automation in Android
Build Automation in Android
 
WindowTester PRO
WindowTester PROWindowTester PRO
WindowTester PRO
 
DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合
 
No more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola SolutionsNo more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola Solutions
 
Trunk-Based Development
Trunk-Based DevelopmentTrunk-Based Development
Trunk-Based Development
 
Behat sauce
Behat sauceBehat sauce
Behat sauce
 
Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetup
 
Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
Eclipse RCP outside of Eclipse IDE - Gradle to the rescue!
 
Getting started with docker
Getting started with dockerGetting started with docker
Getting started with docker
 
Fastlane on Android 介紹
Fastlane on Android 介紹Fastlane on Android 介紹
Fastlane on Android 介紹
 
Eclipse RCP Demo
Eclipse RCP DemoEclipse RCP Demo
Eclipse RCP Demo
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
 
Eclipse Buildship JUG Hamburg
Eclipse Buildship JUG HamburgEclipse Buildship JUG Hamburg
Eclipse Buildship JUG Hamburg
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Continuous integration in games development
Continuous integration in games developmentContinuous integration in games development
Continuous integration in games development
 
iOS Automation with Cucumber, Appium and Saucelabs
iOS Automation with Cucumber, Appium and SaucelabsiOS Automation with Cucumber, Appium and Saucelabs
iOS Automation with Cucumber, Appium and Saucelabs
 

Viewers also liked

Introducing Cardio
Introducing CardioIntroducing Cardio
Introducing CardioYusuke Kita
 
Android development at mercari 2015
Android development at mercari 2015Android development at mercari 2015
Android development at mercari 2015Tomoaki Imai
 
はじめての CircleCI
はじめての CircleCIはじめての CircleCI
はじめての CircleCIYosuke Mizutani
 
US進出でのAndroid開発inメルカリ Mercari US App Development
US進出でのAndroid開発inメルカリ Mercari US App Development US進出でのAndroid開発inメルカリ Mercari US App Development
US進出でのAndroid開発inメルカリ Mercari US App Development Tomoaki Imai
 
Debot android debugging library
Debot android debugging libraryDebot android debugging library
Debot android debugging libraryTomoaki Imai
 
MS Fest 2013: Vývoj her v C# a MonoGame pro WP, iOS a Android
MS Fest 2013: Vývoj her v C# a MonoGame pro WP, iOS a AndroidMS Fest 2013: Vývoj her v C# a MonoGame pro WP, iOS a Android
MS Fest 2013: Vývoj her v C# a MonoGame pro WP, iOS a AndroidTomáš Slavíček
 
Bezpečnost platformy Android
Bezpečnost platformy AndroidBezpečnost platformy Android
Bezpečnost platformy AndroidJana Moudrá
 
What I learned about communication in Sanfrancisco
What I learned about communication in SanfranciscoWhat I learned about communication in Sanfrancisco
What I learned about communication in SanfranciscoTomoaki Imai
 
CI in the mobile world
CI in the mobile worldCI in the mobile world
CI in the mobile worldGodfrey Nolan
 
Enterprise level cloud CI
Enterprise level cloud CIEnterprise level cloud CI
Enterprise level cloud CISQUADEX
 
Cocoa勉強会#62-新しい通信クラス群NSURLSessionを使ってみる
Cocoa勉強会#62-新しい通信クラス群NSURLSessionを使ってみるCocoa勉強会#62-新しい通信クラス群NSURLSessionを使ってみる
Cocoa勉強会#62-新しい通信クラス群NSURLSessionを使ってみるMasayuki Nii
 
Androidアプリ滞在時間の計測
Androidアプリ滞在時間の計測Androidアプリ滞在時間の計測
Androidアプリ滞在時間の計測Shigeki Yamato
 
Material Designなdrawerを実装したい
Material Designなdrawerを実装したいMaterial Designなdrawerを実装したい
Material Designなdrawerを実装したいshinya sakemoto
 
Ci tools Introduce
Ci tools IntroduceCi tools Introduce
Ci tools IntroduceYin-Hong Hsu
 
Fast deterministic screenshot tests for Android
Fast deterministic screenshot tests for AndroidFast deterministic screenshot tests for Android
Fast deterministic screenshot tests for AndroidArnold Noronha
 
Developing better debug_components
Developing better debug_componentsDeveloping better debug_components
Developing better debug_componentsTomoaki Imai
 
ハンドメイドカレンダー第15回potatotips用
ハンドメイドカレンダー第15回potatotips用ハンドメイドカレンダー第15回potatotips用
ハンドメイドカレンダー第15回potatotips用Fumiya Sakai
 

Viewers also liked (20)

Introducing Cardio
Introducing CardioIntroducing Cardio
Introducing Cardio
 
Android development at mercari 2015
Android development at mercari 2015Android development at mercari 2015
Android development at mercari 2015
 
はじめての CircleCI
はじめての CircleCIはじめての CircleCI
はじめての CircleCI
 
US進出でのAndroid開発inメルカリ Mercari US App Development
US進出でのAndroid開発inメルカリ Mercari US App Development US進出でのAndroid開発inメルカリ Mercari US App Development
US進出でのAndroid開発inメルカリ Mercari US App Development
 
Debot android debugging library
Debot android debugging libraryDebot android debugging library
Debot android debugging library
 
MS Fest 2013: Vývoj her v C# a MonoGame pro WP, iOS a Android
MS Fest 2013: Vývoj her v C# a MonoGame pro WP, iOS a AndroidMS Fest 2013: Vývoj her v C# a MonoGame pro WP, iOS a Android
MS Fest 2013: Vývoj her v C# a MonoGame pro WP, iOS a Android
 
Bezpečnost platformy Android
Bezpečnost platformy AndroidBezpečnost platformy Android
Bezpečnost platformy Android
 
Kdyby/Events
Kdyby/EventsKdyby/Events
Kdyby/Events
 
What I learned about communication in Sanfrancisco
What I learned about communication in SanfranciscoWhat I learned about communication in Sanfrancisco
What I learned about communication in Sanfrancisco
 
CI in the mobile world
CI in the mobile worldCI in the mobile world
CI in the mobile world
 
Enterprise level cloud CI
Enterprise level cloud CIEnterprise level cloud CI
Enterprise level cloud CI
 
Cocoa勉強会#62-新しい通信クラス群NSURLSessionを使ってみる
Cocoa勉強会#62-新しい通信クラス群NSURLSessionを使ってみるCocoa勉強会#62-新しい通信クラス群NSURLSessionを使ってみる
Cocoa勉強会#62-新しい通信クラス群NSURLSessionを使ってみる
 
Androidアプリ滞在時間の計測
Androidアプリ滞在時間の計測Androidアプリ滞在時間の計測
Androidアプリ滞在時間の計測
 
Material Designなdrawerを実装したい
Material Designなdrawerを実装したいMaterial Designなdrawerを実装したい
Material Designなdrawerを実装したい
 
Ci tools Introduce
Ci tools IntroduceCi tools Introduce
Ci tools Introduce
 
Fast deterministic screenshot tests for Android
Fast deterministic screenshot tests for AndroidFast deterministic screenshot tests for Android
Fast deterministic screenshot tests for Android
 
Developing better debug_components
Developing better debug_componentsDeveloping better debug_components
Developing better debug_components
 
Core Principles Of Ci
Core Principles Of CiCore Principles Of Ci
Core Principles Of Ci
 
What makes Geb groovy?
What makes Geb groovy?What makes Geb groovy?
What makes Geb groovy?
 
ハンドメイドカレンダー第15回potatotips用
ハンドメイドカレンダー第15回potatotips用ハンドメイドカレンダー第15回potatotips用
ハンドメイドカレンダー第15回potatotips用
 

Similar to Tips for better CI on Android

Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013dotCloud
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Digging for Android Kernel Bugs
Digging for Android Kernel BugsDigging for Android Kernel Bugs
Digging for Android Kernel BugsJiahong Fang
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Containers from Scratch: what are they made from?
Containers from Scratch: what are they made from?Containers from Scratch: what are they made from?
Containers from Scratch: what are they made from?Giri Kuncoro
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentKarim Yaghmour
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on DockerRightScale
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
ContainerCon sysdig Slides
ContainerCon sysdig Slides ContainerCon sysdig Slides
ContainerCon sysdig Slides Loris Degioanni
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 

Similar to Tips for better CI on Android (20)

Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Digging for Android Kernel Bugs
Digging for Android Kernel BugsDigging for Android Kernel Bugs
Digging for Android Kernel Bugs
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Containers from Scratch: what are they made from?
Containers from Scratch: what are they made from?Containers from Scratch: what are they made from?
Containers from Scratch: what are they made from?
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on Docker
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Us 17-krug-hacking-severless-runtimes
Us 17-krug-hacking-severless-runtimesUs 17-krug-hacking-severless-runtimes
Us 17-krug-hacking-severless-runtimes
 
ContainerCon sysdig Slides
ContainerCon sysdig Slides ContainerCon sysdig Slides
ContainerCon sysdig Slides
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 

Recently uploaded

What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 

Recently uploaded (20)

What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 

Tips for better CI on Android

  • 1. Tips for better CI on Android Tomoaki Imai @Potatotips #22 2015/10/13
  • 8. 1. How do we CI on Android 2. 4 tips for better CI
  • 9. 1. How do we CI on Android 2. 4 tips for better CI
  • 10. How do we CI Mercari Android App?
  • 11. CI for Mercari Android App • Started April 2015 • Purpose - Build Check each Flavour and BuildType - Automate app tests - Continuous deployment
  • 13. Good!! • Easy setup with yml • Build production app without including secret keys into the repo(http://docs.travis-ci.com/user/encrypting- files/) • Most of Mercari project run CI on Travis CI
  • 14. So-so… • Need some tweaks to avoid Out of Memory • Slow. Takes 12-15min/per build check
  • 16. Good!! • Has better features for testing and debugging • Bit faster than Travis CI (1- 2min for each build) • Mercari iOS project runs CI on CircleCI
  • 17. So-so… • Need some tweaks to avoid Out of Memory • Building production app looked a bit tricky (Haven’t tried yet)
  • 18. Both CI service have good parts…
  • 19. Why not use both?
  • 20. Phase 3: Travis CI & circleCI
  • 21. Check Production App Check Development App Run JUnit Tests Deploy Let each CI service do different tasks
  • 22. Total CI Running time reduced to 8-7 min(about 2x shorter)
  • 23. 1. How do we CI on Android 2. 4 tips for better CI
  • 24. Tip 1: Avoid OOM(CircleCI) • 4GB memory limit
  • 25. Tip 1: Avoid OOM(CircleCI) • 4GB memory limit
  • 26. Tip 1: Avoid OOM(CircleCI) https://circleci.com/docs/oom but was in vain… Guide for 4GB limit
  • 28. PID RSS %CPU COMMAND 21787 2250024 165 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xmx4g - Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /usr/ local/android-sdk-linux/build-tools/21.1.1/lib/dx.jar com.android.dx.command.Main -- dex --force-jumbo --output /home/ubuntu/mercari-android-as/app/build/intermediates/ dex/us/dev /home/ubuntu/mercari-android-as/app/build/intermediates/classes-proguard/ us/dev/classes.jar 9477 1628300 104 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -XX: +HeapDumpOnOutOfMemoryError -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US - Duser.language=en -Duser.variant -cp /home/ubuntu/.gradle/wrapper/dists/gradle-2.2.1- all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1/lib/gradle-launcher-2.2.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 2.2.1 /home/ubuntu/.gradle/daemon 10800000 b3531fa1-fad3-4599-a284-96a81cc9336b -XX:+HeapDumpOnOutOfMemoryError - Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant 9145 279164 4.7 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xms256m -Xmx512m - Dorg.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError - Dorg.gradle.appname=gradlew -classpath /home/ubuntu/mercari-android-as/gradle/wrapper/ gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain assembleDev -PdisablePreDex Tip 1: Avoid OOM(CircleCI)
  • 29. PID RSS %CPU COMMAND 21787 2250024 165 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xmx4g - Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /usr/ local/android-sdk-linux/build-tools/21.1.1/lib/dx.jar com.android.dx.command.Main -- dex --force-jumbo --output /home/ubuntu/mercari-android-as/app/build/intermediates/ dex/us/dev /home/ubuntu/mercari-android-as/app/build/intermediates/classes-proguard/ us/dev/classes.jar 9477 1628300 104 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -XX: +HeapDumpOnOutOfMemoryError -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US - Duser.language=en -Duser.variant -cp /home/ubuntu/.gradle/wrapper/dists/gradle-2.2.1- all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1/lib/gradle-launcher-2.2.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 2.2.1 /home/ubuntu/.gradle/daemon 10800000 b3531fa1-fad3-4599-a284-96a81cc9336b -XX:+HeapDumpOnOutOfMemoryError - Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant 9145 279164 4.7 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xms256m -Xmx512m - Dorg.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError - Dorg.gradle.appname=gradlew -classpath /home/ubuntu/mercari-android-as/gradle/wrapper/ gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain assembleDev -PdisablePreDex Tip 1: Avoid OOM(CircleCI) JVM is using too much memory! 2250024 + 1628300 + 279164 = 4157488KB ≒4GB
  • 30. PID RSS %CPU COMMAND 21787 2250024 165 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xmx4g - Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /usr/ local/android-sdk-linux/build-tools/21.1.1/lib/dx.jar com.android.dx.command.Main -- dex --force-jumbo --output /home/ubuntu/mercari-android-as/app/build/intermediates/ dex/us/dev /home/ubuntu/mercari-android-as/app/build/intermediates/classes-proguard/ us/dev/classes.jar 9477 1628300 104 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -XX: +HeapDumpOnOutOfMemoryError -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US - Duser.language=en -Duser.variant -cp /home/ubuntu/.gradle/wrapper/dists/gradle-2.2.1- all/6dibv5rcnnqlfbq9klf8imrndn/gradle-2.2.1/lib/gradle-launcher-2.2.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 2.2.1 /home/ubuntu/.gradle/daemon 10800000 b3531fa1-fad3-4599-a284-96a81cc9336b -XX:+HeapDumpOnOutOfMemoryError - Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant 9145 279164 4.7 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xms256m -Xmx512m - Dorg.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError - Dorg.gradle.appname=gradlew -classpath /home/ubuntu/mercari-android-as/gradle/wrapper/ gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain assembleDev -PdisablePreDex Tip 1: Avoid OOM(CircleCI) Progard + Gradle consumes memory a lot
  • 31. Tip 1: Avoid OOM(CircleCI) Tuning tips: • Lower the total memory(JVM,Gradle) size to 4.0G • Adjust Xmx and MaxPermSize • Set timeout (>1000) for GC Xmx -> Heap space (where object resources are allocated ) MaxPermSize -> Permgen(where class, methods are loaded)
  • 32. Tip 1: Avoid OOM(CircleCI) machine:
 environment:
 ANDROID_HOME: /usr/local/android-sdk-linux
 _JAVA_OPTIONS: "-Xms256m -Xmx1280m -XX:MaxPermSize=350m"
 GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1536m - XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError"' … override:
 - ./gradlew assembleDev -PdisablePreDex:
 timeout: 1500 Heap Perm Heap Perm other JVM(dex) Gradle 4GB • There is no best practice but I suggest that large memory be allocated to Xmx
  • 33. Tip 2: Save the JUnit test result(CircleCI) test:
 post:
 - mkdir -p $CIRCLE_TEST_REPORTS/junit/
 - find . -type f -regex ".*/test-results/*/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ ; • You can check Test result from ‘Test Failure’ http://qiita.com/tomoima525/items/b4a91d1624aaf0112b3f Ref. CircleCIでJUnitの結果を見る
  • 34. Tip 3: Continuous deployment for specific branches(CircleCI) • Run shell script for specific branches deployment:
 jp:
 branch: [/deploy_jp_.*/, /release_.*/]
 commands:
 - ./deploy_jp.sh $CIRCLE_BRANCH
 us:
 branch: [/deploy_us_.*/, /release_.*/]
 commands:
 - ./deploy_us.sh $CIRCLE_BRANCH RELEASE_MESSAGE=$1 #deploy
 curl -F "file=@app/apk/mercari_dev_jp.apk" -F "token=$ {DEPLOY_GATE_API_KEY}" -F "message=${RELEASE_MESSAGE}" -F "distribution_key=${JP_DEV_DIST_KEY}" -F "release_note=$ {RELEASE_MESSAGE}" https://deploygate.com/api/users/xxxx/apps deploy_jp.sh
  • 35. Tip 3: Continuous deployment for specific branches(CircleCI) • Set variables at `Environment variables`
  • 36. Tip 4: Add dependencies manually dependencies: override: - echo y | android update sdk --no-ui --all --filter extra- google-m2repository,extra-android-m2repository,build-tools-23.0.1, android-23 android: components: - build-tools-23.0.1 - android-23 - extra-android-m2repository - extra-google-m2repository .travis.yml circle.yml • The latest packages(ex. Android M) are not installed on the VM • Add manually with command line
  • 37. • Tip 1: Check memory usage of JVM to avoid OOM • Tip 2: Save the JUnit test result on the VM • Tip 3: Continuous deployment for specific branches • Tip 4: Add dependencies manually
  • 38. Try it out for your project!