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.8k
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.8k
Effective Espresso #roppongi_aar
misumirize
0
2.1k
某イベントを支えるRuby
misumirize
0
930
Being Flux on Electron
misumirize
2
1.2k
Other Decks in Technology
See All in Technology
アプリがつくるNOT A HOTELブランド
hokuts
0
450
Aurora MySQL v3(MySQL8.0互換)の オンラインDDLの罠挙動を全バージョンで検証した
yutakikai
0
150
【SORACOM UG】SIM Deep Dive セキュアエレメント編
soracom
PRO
0
250
2024/4/26 コンピュータ歴史博物館解説告知
toshi_atsumi
0
190
オブザーバビリティの Primary Signals
onk
PRO
0
540
レガシーをぶっ壊せ。AEONで始めるDevRelの話 / Qiita Night 2024-2-22
aeonpeople
3
140
SIEMを用いて、セキュリティログ分析の可視化と分析を実現し、PDCAサイクルを回してみた
coconala_engineer
0
200
"好き"との生活/Regularly update profile with GitHub Actions
judeeeee
0
150
強みを伸ばすキャリアデザイン
yug1224
0
200
HEXA OSINT CTF V3 作戦会議
meow_noisy
0
110
ユーザーストーリーのレビューを自動化したみたの
bun913
1
300
プロデザ! BY リクルート vol.18_リクルートのリサーチ実践組織「リサーチブーストコミュニティ」
recruitengineers
PRO
2
230
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
272
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
13
1.5k
Learning to Love Humans: Emotional Interface Design
aarron
266
39k
What's in a price? How to price your products and services
michaelherold
237
11k
What's new in Ruby 2.0
geeforr
336
31k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
219
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
18
1.7k
Agile that works and the tools we love
rasmusluckow
323
20k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Code Review Best Practice
trishagee
54
15k
Docker and Python
trallard
33
2.7k
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.