Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Androidアプリケーションのビルド体験をリモートインスタンスで改善する

800912a73ce4e879003b6c89cf80cfeb?s=47 yagi
February 01, 2017

 Androidアプリケーションのビルド体験をリモートインスタンスで改善する

Enjoy Android Application Development !

800912a73ce4e879003b6c89cf80cfeb?s=128

yagi

February 01, 2017
Tweet

Transcript

  1. "OESPJEΞϓϦέʔγϣϯ ͷϏϧυମݧΛϦϞʔτΠϯ ελϯεͰվળ͢Δ 2017/02/01 ୈ2ճελʔτΞοϓAndroidษڧձ Toshihiro Yagi

  2. ࣗݾ঺հ w 5PTIJIJSP:BHJ !TZTZBHJ  w DPPLQBE w "OESPJEΤϯδχΞ ٕज़෦௕

  3. "OESPJEΞϓϦέʔγϣϯ ͷϏϧυͷ՝୊ w Ϗϧυʹ͕͔͔࣌ؒΔ w ϏϧυΛ଴ͭؒ$16΍ϝϞϦΛઐ༗ ͞Εͯ͠·ͬͯଞͷ࡞ۀ͕Ͱ͖ͳ͍

  4. "OESPJEΞϓϦέʔγϣϯ ͷϏϧυͷ՝୊ w Ϗϧυʹ͕͔͔࣌ؒΔ w ϏϧυΛ଴ͭؒ$16΍ϝϞϦΛઐ༗ ͞Εͯ͠·ͬͯଞͷ࡞ۀ͕Ͱ͖ͳ͍

  5. None
  6. ରࡦ w CVJMEHSBEMFΛνϡʔχϯά w *OTUBOU3VOΛ࢖͏ w ϋΠεϖοΫϚγϯΛௐୡ

  7. ରࡦ w CVJMEHSBEMFΛνϡʔχϯά w *OTUBOU3VOΛ࢖͏ w ϋΠεϖοΫϚγϯΛௐୡ w ϦϞʔτϏϧυΛ࢖͏OFX

  8. ϦϞʔτϏϧυͷงғؾ Local Machine ᶃ sync code Remote Machine ᶄ build

    ᶅ get apk ᶆ install apk & launch activity Ϗϧυͷ෦෼ΛϦϞʔτϚγϯʹҕৡ͢Δ͜ͱͰ ϩʔΧϧϚγϯͷϦιʔεΛઐ༗͠ͳ͍
  9. ϦϞʔτϏϧυͷར఺ w ϩʔΧϧϚγϯͷϦιʔεΛѹഭ͠ͳ͍ w ෳ਺ͷϚγϯ͔Β࢖͑Δ؀ڥΛͭ͘ΕΔ w ϦϞʔτϚγϯͷεϖοΫ࣍ୈͰύϑΥʔ Ϛϯε͸ແݶେ w Ϋϥ΢υΛ࢖͏৔߹

    ࣗ༝ʹࣺͯΒΕΔ
  10. ϦϞʔτϏϧυ؀ڥߏஙखॱ w ϦϞʔτϚγϯΛ༻ҙ͢Δ w ϦϞʔτϚγϯͷ؀ڥΛ࡞Δ w ϦϞʔτϏϧυ༻ͷεΫϦϓτΛ༻ҙ͢Δ w ࢖͏ɻշదɻ࠷ߴ?P? w

    ίετͱ޻෉
  11. ϦϞʔτϚγϯΛ༻ҙ͢Δ w ༨ͬͨϚγϯ w ϦϞʔτΠϯελϯε ($1 "84 "[VSFʜ

  12. ϦϞʔτϚγϯΛ༻ҙ͢Δ w ༨ͬͨϚγϯ w ϦϞʔτΠϯελϯε ($1 "84 "[VSFʜ

  13. ϦϞʔτϚγϯͷ؀ڥΛ࡞Δ w "84 ($1ͳͲͰΠϯελϯεΛ࡞Δ w ϦϞʔτϚγϯͷ੩త*1Λઃఆ͢Δ w BOESPJEͷϏϧυ؀ڥΛߏங͢Δ w ϩʔΧϧϚγϯͰTTILFZΛൃߦͯ͠ొ࿥͢Δ

  14. ϦϞʔτϚγϯͷ؀ڥΛ࡞Δ http://sys1yagi.hatenablog.com/entry/2016/11/13/162400

  15. ϦϞʔτϏϧυ༻ͷ εΫϦϓτΛ༻ҙ͢Δ GBCSJDΛ࢖ͬͨྫ @task def build(): build_dir = tmp_dir +

    package sync(build_dir) gradle_cmd = assemble_command() apk_name = apk_name_format() # run gradlew on remote instance with cd(build_dir): run(gradle_cmd) # get apk local("mkdir -p " + module + "/build/outputs/apk/") get(remote_path=build_dir + "/" + module + "/build/outputs/apk/" + apk_name, local_path=module + "/build/outputs/apk/") # start App local("adb" + " push ./" + module + "/build/outputs/apk/" + apk_name + " /data/local/tmp/" + package) local("adb" + " shell pm install -r '/data/local/tmp/" + package + "'") local("adb" + " shell am start -n '" + package + "/" + launch_activity + "' -a android.intent.action.MAIN -c android.intent.category.LAUNCHER")
  16. ࢖͏ɻշదɻ࠷ߴ?P?

  17. ίετͱ޻෉ w େମշదͳεϖοΫ w ($1OIJHIDQV ถࠃ I w "84DYMBSHF ౦ژ

    I w ͣͬͱىಈͬ͠ͺͳ͠ͷ৔߹ֹ݄ w ($1 w "84
  18. ࣗಈγϟοτμ΢ϯ w $MPVE8BUDIΛ࢖ͬͨࣗಈγϟοτμ΢ϯ "84  w ͖͍͠஋Λz࣌ؒʹର͢Δ$166UJMJ[BUJPO $166UJMJ[BUJPO zͰઃఆ w

    ΞΫγϣϯͱͯ͠γϟοτμ΢ϯΛઃఆ w ىಈ͸GBCSJDͰCPUPΛ࢖ͬͯϏϧυ࣌ʹ௚઀"1* Λୟ͘ w ($1͸DSPO࢓ࠐΉͱ͔ʹͳΓͦ͏ɻHDMPVEͰىಈ
  19. ϲ݄ͷར༻࣌ؒͱίετ w ΤϯδχΞ໊ w ߹ܭར༻࣌ؒd࣌ؒ w ֹ݄d w Ұਓ͋ͨΓd

  20. ମݧ͕͍͍͘͢͝ͷͰੋඇ͓ࢼ͍ͩ͘͠͞ɻ

  21. ͱΓ͋͑ͣؾܰʹࢼͯ͠Έ͍ͨͱ ͍͏࣌͸

  22. $ZCPSH#VJME http://cyborg-build.com/

  23. $ZCPSH#VJMEͷ࢓૊Έ Local Machine GCS Bucket Cyborg-Build.com Remote Instance ᶃrsync code

    ᶄbuild request ᶅremote op ᶆrsync code ᶇbuild on docker ᶈupload artefacts ᶉdownload artefacts ᶊinstall & launch ϩάΠϯͨ͠(PPHMFΞΧ΢ϯτͱDZCPSHCVJMEDPNͷΈ͕ιʔείʔυʹ৮ΕΔߏ଄
  24. "MQIB1SFWJFX w ࠓͷͱ͜Ζແྉ w HDMPVE GBCSJDͰར༻Մೳ w CVJMEMBVODIͷ΄͔UFTU΍MJOU݁Ռͷอଘͳ Ͳ΋αϙʔτ w

    *%&"QMVHJOԽ༧ఆ w ͥͻ͓ࢼ͍ͩ͘͠͞ϑΟʔυόοΫ͍ͩ͘͞
  25. &OKPZ "OESPJE"QQMJDBUJPO %FWFMPQNFOU