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

iOSの自動化と仕組み化 ~コードと設計に集中する~

iOSの自動化と仕組み化 ~コードと設計に集中する~

Mercari Meetup for Mobile App Engineer in Fukuoka
https://mercari.connpass.com/event/83957/

Motoki Narita

May 01, 2018
Tweet

More Decks by Motoki Narita

Other Decks in Technology

Transcript

  1. iOSͷࣗಈԽͱ࢓૊ΈԽ
    ~ίʔυͱઃܭʹूத͢Δ~
    Mercari Drink Meetup for Mobile App Engineer in Fukuoka

    View full-size slide

  2. ࣗݾ঺հ
    • GitHub: motokiee
    • twitter: @motokiee
    • ι΢κ΢ → ϝϧΧϦ
    • iOSΤϯδχΞ
    • Ϗʔϧ͕޷͖
    • iOSDC Japan 2016 / 2017 / 2018 ίΞελοϑ

    View full-size slide

  3. ࣗݾ঺հ
    • GitHub: motokiee
    • twitter: @motokiee
    • ι΢κ΢ → ϝϧΧϦ
    • iOSΤϯδχΞ
    • Ϗʔϧ͕޷͖
    • iOSDC Japan 2016 / 2017 / 2018 ίΞελοϑ

    View full-size slide

  4. ෭ୂ௕΍ͬͨΓɺΦʔϓχϯάϜʔϏʔ࡞ͬͨΓɺެࣜΞϓϦ࡞ͬͨΓɺϊϕϧςΟ࡞ͬͨΓɻ

    ࠷ߴͷΧϯϑΝϨϯεΛ࡞ΔͨΊʹελοϑͱҰॹʹؤு͍ͬͯ·͢ʂ

    View full-size slide

  5. iOSDC Japan 2018 ࢝ಈ͠·ͨ͠!
    ΋ͪΖΜϝϧΧϦ΋εϙϯαʔ΍Γ·͢!!
    ୈҰճ͔Β3೥࿈ଓ!!

    View full-size slide

  6. ࣗݾ঺հ
    • GitHub: motokiee
    • twitter: @motokiee
    • ι΢κ΢ → ϝϧΧϦ
    • iOSΤϯδχΞ
    • Ϗʔϧ͕޷͖
    • iOSDC Japan 2016 / 2017 / 2018 ίΞελοϑ

    View full-size slide

  7. ͕޷͖
    ࿡ຊ໦ͷBrewdogͱ͍͏ΫϥϑτϏΞ
    όʔʹि2͘Β͍Ͱߦͬͯ·͢ʢiOSDC
    ͰBrewdogʹग़ձ͍ࠍΕͨʣ

    ౦ژʹདྷͨͱ͖͸ͥͻʂ

    View full-size slide

  8. ίʔυΛॻ͘͜ͱʹूத͢Δ

    View full-size slide

  9. Ͳ͏΍ͬͯʁ

    View full-size slide

  10. ίʔυΛॻ͘͜ͱʹूத͢Δํ๏
    • ϛʔςΟϯάΛݮΒ͢
    • ܦඅਃ੥ͱ͔׳Εͯͳͯ࣌ؒ͘ͷ͔͔Δ࡞ۀΛݮΒ͢
    • ੩͔ͳ؀ڥͰूத͢Δ
    • υϦϯΫങ͍ʹߦͬͨϦ͢ΔҠಈ࣌ؒΛݮΒ͢

    View full-size slide

  11. ϝϧΧϦͩͱ
    ͍͍ͩͨ؀ڥ੔͍ͬͯΔ

    View full-size slide

  12. ίʔυΛॻ͘͜ͱʹूத͢Δํ๏
    • ϛʔςΟϯάΛݮΒ͢

    → ϛʔςΟϯά͸ܾΊΔ৔ɻ͍ͨͣΒʹਓΛݺ͹ͳ͍
    • ܦඅਃ੥ͱ͔׳Εͯͳͯ࣌ؒ͘ͷ͔͔Δ࡞ۀΛݮΒ͢

    → ࣾ৯ΞϓϦಋೖͳͲ࠷খݶʹͳΔΑ͏഑ྀ͞Ε͍ͯΔ
    • ੩͔ͳ؀ڥͰूத͢Δ

    → ूதBOXϧʔϜ͕͋Δ
    • υϦϯΫങ͍ʹߦͬͨϦ͢ΔҠಈ࣌ؒΛݮΒ͢

    → υϦϯΫແྉ

    View full-size slide

  13. Ͱ͸ΤϯδχΞ͸ԿΛ͢Δ͔ʁ

    View full-size slide

  14. Automation, Karakuri

    View full-size slide

  15. ࣗಈԽͱ࢓૊ΈԽ

    View full-size slide

  16. ίʔυΛॻ͘Ҏ֎ͷ͜ͱΛͳΔ΂ࣗ͘ಈԽ
    • Ϗϧυͷ഑෍
    • ϦϦʔε࡞ۀ
    • αϒϛοτ
    • ϨϏϡʔ

    View full-size slide

  17. ※ ϝϧΧϦ Χ΢ϧνʔϜͰͷऔΓ૊Έʹ͍ͭͯઆ໌͍ͯ͠
    ·͕͢ɺϝϧΧϦ΋΄΅ಉ͜͡ͱΛ͍ͯ͠·͢

    View full-size slide

  18. ίʔσΟϯάͷޮ཰ͱ࢓૊ΈԽ

    View full-size slide

  19. swiftlint autocorrect

    View full-size slide

  20. • Τϥʔ΍ϫʔχϯάΛࣗಈͰमਖ਼͢ΔίϚϯυ
    • ίʔσΟϯάن໿͸ࡉ͔ܾ͘ΊͣʹσϑΥϧτઃఆ
    ○ ͔ͳΓࡉ͔ܾ͘Ίͨ͜ͱ΋͕͋ͬͨσϑΥϧτͰ
    େ͖ͳ໰୊͕ى͖ͨ͜ͱ͸ͳ͍

    View full-size slide

  21. • ίʔυϨϏϡʔͷࣗಈԽπʔϧ
    • DangerfileͰઃఆΛهड़
    • ϦϦʔεϊʔτͷߋ৽(ޙड़)๨Ε΍ɺιʔε
    ίʔυͷมߋͱυΩϡϝϯτԽ͕࿈ಈ͢Δ΋
    ͷɺTODO:΍FIXME:͕࢒͍ͬͯͳ͍͔؂ࢹ

    View full-size slide

  22. ϑΥʔϚοτɺίʔσΟϯά͔Β೿ੜ͢Δ࡞ۀͳͲ
    ๨Ε͕ͪͳ͜ͱΛޮ཰Խ
    → ઃܭͱίʔυͷ඼࣭ʹूத

    View full-size slide

  23. Ϗϧυͷ഑෍

    View full-size slide

  24. αϒϛοτલ΍QAظؒͰ
    ΍Δ͜ͱ͸ҙ֎ͱଟ͍

    View full-size slide

  25. σβΠφʔͷUIνΣοΫ
    ʮ͋ͷػೳͷσβΠϯͬͯ΋͏ݟΒΕΔʁʯ

    View full-size slide

  26. όοΫΤϯυνʔϜͱͷ࿈ܞ

    ʮ͋ͷAPIͬͯ΋͏ݕূ։࢝Ͱ͖·͢ʁ 

    xx೔ϦϦʔεͳΜͰ͚͢Ͳʯ

    View full-size slide

  27. QAνʔϜ΁ͷ࿈བྷ

    View full-size slide

  28. CIͷઃఆ(Bitrise)
    • Unit Test͸push͝ͱʹ

    → յΕͨ৔߹ʹ͙͢ݕ஌
    • masterϒϥϯνʹpush/mergeͰFabric΁Ξοϓϩʔυ

    → ଞͷ։ൃϝϯόʔ͕͙͢ʹ৽͍͠ػೳΛࢼ͢͜ͱ͕Ͱ͖Δ
    • release/* ΁ͷpush/mergeͰFabric΁ͷΞοϓϩʔυˍiTunes Connect΁
    ͷΞοϓϩʔυ

    → ϦϦʔεީิ͸QAऴྃΛ଴ͨͣʹiTCʹΞοϓϩʔυ

    View full-size slide

  29. ϦϦʔεީิ͕Ξοϓϩʔυ͞Εͨ͜ͱΛSlackͰ௨஌ɺQAνʔϜ͸
    ϏϧυΛ͙͢ʹ৮ΕΔˍ։ൃϝϯόʔ͸αϒϛοτ͕͍͍ۙͮͯΔ͜
    ͱ͕෼͔Δ

    View full-size slide

  30. “ਖ΋ੵ΋Ε͹ࢁͱͳΔ”
    • खಈͰ఻͑ͳ͍ͱ͍͚ͳ͍ͷͰϦϦʔε༻Ϗϧυ͕ऴΘ͔ͬͨͲ͏͔Λ
    ؾʹ͍ͯ͠ͳ͍ͱ͍͚ͳ͍ = ूதͰ͖ͳ͍
    • ผͷ͜ͱʹूதͯ͠๨Ε͍ͯͨΓ͢ΔͱQAνʔϜ͸࿈བྷΛ଴ͭ͜ͱʹͳ
    Δ
    • ΤϯδχΞɺQAΤϯδχΞͱ΋ʹଟ͘ͷ࣌ؒΛແବʹ͍ͯͨ͠ʢ͸ͣʣ

    View full-size slide

  31. ϦϦʔεؔ࿈࡞ۀ

    View full-size slide

  32. iTunes Connectؔ࿈ͷ࡞ۀ
    • ϦϦʔεϊʔτͳͲͷϝλσʔλߋ৽
    • αϒϛοτ
    • ϦδΣΫτରԠ
    • ϦϦʔε࡞ۀ

    View full-size slide

  33. iTunes Connectͷϝλσʔλ؅ཧ

    View full-size slide

  34. Pull RequestϕʔεͰࠩ෼؅ཧ

    View full-size slide

  35. iTunesConnectͷ
    εςʔλε؂ࢹ

    View full-size slide

  36. iTunesConnectͷεςʔλε؂ࢹ
    • ੵΈॏͳΔͱෛ୲ʹͳΔ
    • αϒϛοτޙͷ৹ࠪঢ়گ͸ΤϯδχΞҎ֎΋ؾʹͳΔ
    • αϒϛοτޙ͸ΤϯδχΞ͕εςʔλεʹ͍ͭͯ࿈བྷ͢Δ
    • ʮreject͞Ε·ͨ͠ʯʮ৹ࠪ௨ͬͨͷͰϦϦʔε͠·͢ʯͳͲ
    • ؾʹ͸ͳΔΜ͚ͩͲɺiOSΤϯδχΞҎ֎͸ͦ͜·Ͱதࢭͯ͠ͳ͍

    View full-size slide

  37. ͜Μͳײ͡ͷը૾ΛSlackʹషͬͯप஌͍ͯͨ͠

    View full-size slide

  38. ΊͪΌͪ͘Ό໘౗

    View full-size slide

  39. Google Apps ScriptͰiTunes ConnectͷϝʔϧνΣοΫ
    &
    Slack౤ߘ

    View full-size slide

  40. ਓؒͷ΍Δ͜ͱͰ͸ͳ͔ͬͨ
    ※ϝϧνϟϦνʔϜ΋ಉ༷ͷεΫϦϓτ࢖ͬͯ·͢

    View full-size slide

  41. GASͰ࢖͑ΔscriptΛgistͰެ։ͯ͠·͢
    https://gist.github.com/motokiee/39a875e97349fe9325314bdae9d3af2a

    View full-size slide

  42. ࠷ऴతʹiTunes ConnectΛ։͘ͷ͸

    View full-size slide

  43. 1.৹ࠪʹఏग़͢Δͱ͖
    a.ఏग़͢ΔϏϧυΛઃఆ͢Δͱ͖
    2.ϦϦʔε͢Δͱ͖
    ͚ͩʂ

    View full-size slide

  44. େࣄͳϘλϯΛϙνΔ͜ͱ͚ͩ

    View full-size slide

  45. ·ͱΊ
    • ೋ౓΍Δ͜ͱ͸ࣗಈԽɺ࢓૊ΈԽ͢Δ
    • ίʔυͷ඼࣭Λ্͛ΔͨΊʹɺίʔυ΍ઃܭʹूத͢ΔͨΊʹ༨
    ܭͳ͜ͱΛߟ͑ͳ͍Α͏ʹࣗಈԽɾ࢓૊ΈԽ͢Δ

    View full-size slide