Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Build your APK beyond Docker #dockerlt
Search
Rize MISUMI
October 14, 2015
Technology
2
2.9k
Build your APK beyond Docker #dockerlt
at Docker 実践 LT
Rize MISUMI
October 14, 2015
Tweet
Share
More Decks by Rize MISUMI
See All by Rize MISUMI
5 Smashing Changes Your Extension Will Encounter #phpblt
misumirize
0
2.9k
Effective Espresso #roppongi_aar
misumirize
0
2.3k
某イベントを支えるRuby
misumirize
0
960
Being Flux on Electron
misumirize
2
1.2k
Other Decks in Technology
See All in Technology
ドメイン駆動設計の実践により事業の成長スピードと保守性を両立するショッピングクーポン
lycorptech_jp
PRO
13
2.2k
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
2.4k
生成AIのビジネス活用
seosoft
0
110
【JAWS-UG大阪 reInvent reCap LT大会 サンバが始まったら強制終了】“1分”で初めてのソロ参戦reInventを数字で振り返りながら反省する
ttelltte
0
140
PaaSの歴史と、 アプリケーションプラットフォームのこれから
jacopen
7
1.5k
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
200
re:Invent2024 KeynoteのAmazon Q Developer考察
yusukeshimizu
1
150
Visual StudioとかIDE関連小ネタ話
kosmosebi
1
380
新卒1年目、はじめてのアプリケーションサーバー【IBM WebSphere Liberty】
ktgrryt
0
130
月間60万ユーザーを抱える 個人開発サービス「Walica」の 技術スタック変遷
miyachin
1
140
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
250
AWSの生成AIサービス Amazon Bedrock入門!(2025年1月版)
minorun365
PRO
7
470
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
A better future with KSS
kneath
238
17k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Building Adaptive Systems
keathley
38
2.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.5k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Git: the NoSQL Database
bkeepers
PRO
427
64k
How GitHub (no longer) Works
holman
312
140k
Transcript
Build your APK beyond Docker Misumi_Rize / Docker࣮ફLT (Oct. 14,
2015)
Log.d("introduction", me); → Twitter @Misumi_Rize → GitHub @MisumiRize → I'm
not Android APK developer
Software Engineer in Test
Testing strategy 1. Unit tests 2. Instrumentation tests 3. Acceptance
tests 4. Exploratory tests
Testing tools 1. JUnit, Mockito 2. Espresso 3. UIAutomator, Appium
4. Human power
Testing APK is difficult → Developer specific problem → CI
service specific problem → APK's state (SQLite, Preference, etc.)
Container CI
Container as CI Service → Docker as a function (Travis
CI, CircleCI, Wercker) → Based on Docker (Drone)
Docker is protocol
https://hub.docker.com/r/misumirize/android-sdk https://github.com/MisumiRize/dockerfiles/tree/ master/android-sdk
FROM misumirize/android-sdk RUN mkdir /project COPY . /project WORKDIR /project
RUN echo "sdk.dir=$ANDROID_HOME" > local.properties ENTRYPOINT ["./gradlew"] CMD ["tasks"]
Run unit tests and generate APK $ docker build -t
android-build . $ docker run android-build build
How can we automate Activity tests?
Too slow and frustrating ARM emulator cf. Travis CI $
echo no | android create avd --force \ --name test --target android-23 --abi armeabi-v7a $ emulator64-arm -avd test -no-skin -no-audio -no-window & $ android-wait-for-emulator $ adb shell input keyevent 82 & $ ./gradlew connectedCheck
Can we connect to another host (e.g. which real device
is connected) from container?
Problem: → ./gradlew connectedCheck wraps ADB client → We can't
configure the host of ADB client → ADB server binds to the loopback address only
Solution: HAProxy
None
Client (container) frontend local_adb_server bind 127.0.0.1:5037 mode tcp default_backend remote_adb_server
backend remote_adb_server mode tcp server remote01 123.45.67.89:5036 check
Server (devices connected) frontend remote_adb_server bind *:5036 mode tcp default_backend
internal_adb_server backend internal_adb_server mode tcp server internal01 127.0.0.1:5037 check
Separating role is important
https://hub.docker.com/r/misumirize/android- remote-client https://github.com/MisumiRize/dockerfiles/tree/ master/android-remote-client
FROM misumirize/android-remote-client CMD ["connectedAndroidTest", "--stacktrace"]
misumirize/android-remote-client ONBUILD COPY haproxy.cfg /etc/haproxy/haproxy.cfg ONBUILD COPY . /project WORKDIR
/project ONBUILD RUN echo "sdk.dir=$ANDROID_HOME" > local.properties ENTRYPOINT ["execute-remote"]
ONBUILD is awesome!
But a little dirty hack is needed... build.gradle com.android.ddmlib.DdmPreferences.setTimeOut(60000)
Example: Connect Docker (CircleCI) and DigitalOcean Droplet (Android Atom emulator
working)
Example https://github.com/MisumiRize/HackerNews- Android https://circleci.com/gh/MisumiRize/HackerNews- Android/22 → circle.yml → Vagrantfile
Conclusion → Docker is protocol → Separating role (even forcefully)
is important → ONBUILD is useful. Consider using ONBUILD
Thank you!
→ Android Lineup - Shadow by Rob Bulmahn → Desastrosos
by srgpicker → cyclotron by Robert Couse-Baker → Containing the containers by Erik Söderström → Nexus 7 with Android 5 by Yuri Samoilov → IMAG0191 by Robert → Hornby Separated Bike Lane by Paul Krueger → A Street Called Awesome by Selena N. B. H.