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
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
530
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
1
200
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
170
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
130
20241220_S3 tablesの使い方を検証してみた
handy
4
400
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
3
260
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
Fanstaの1年を大解剖! 一人SREはどこまでできるのか!?
syossan27
2
170
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
150
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
540
Featured
See All Featured
A designer walks into a library…
pauljervisheath
204
24k
A Tale of Four Properties
chriscoyier
157
23k
YesSQL, Process and Tooling at Scale
rocio
169
14k
The Cult of Friendly URLs
andyhume
78
6.1k
Visualization
eitanlees
146
15k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
RailsConf 2023
tenderlove
29
940
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
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.