SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
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!

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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用
 

Similaire à Tips for better CI on Android

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
 
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.
 
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.
 

Similaire à Tips for better CI on Android (20)

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
 
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
 
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
 

Dernier

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Dernier (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

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!