Skip to content

๐Ÿš€ fastlane

Minha Lee edited this page Dec 1, 2024 · 1 revision

fastlane ์ด๋ž€?

ํ…Œ์ŠคํŠธ ๋ฐ ๋ฐฐํฌ๊นŒ์ง€์˜ ์ผ๋ จ์˜ ๊ณผ์ •์„ ์ž๋™ํ™”ํ•˜์—ฌ ๋ถˆํ•„์š”ํ•œ ์ž‘์—… ์‹œ๊ฐ„์„ ๋‹จ์ถ•ํ•ด์ฃผ๋Š” ์ž๋™ํ™” ํˆด

์ œ๊ณต๋˜๋Š” ๊ธฐ๋Šฅ

  • ์Šคํฌ๋ฆฐ์ƒท ์ž๋™ํ™”
    • ๊ตญ๊ฐ€๋ณ„ ์–ธ์–ด๋กœ ๋ฒˆ์—ญ๋œ ์•ฑ ๋ชจ์Šต์„ ์ž๋™์œผ๋กœ ์บก์ณ ๋ฐ ์•ฑ์Šคํ† ์–ด์— ๋“ฑ๋ก
  • ๋ฒ ํƒ€ ๋ฐฐํฌ ์ž๋™ํ™”
    • ex) iOS์˜ ๋ฐฐํฌํ•˜๊ธฐ ์ „ ํ…Œ์ŠคํŠธ ์•ฑ์„ ์˜ฌ๋ฆฌ๋Š” TestFlight์— ์ž๋™์œผ๋กœ ์˜ฌ๋ผ๊ฐ€๊ฒŒ๋” ๋งŒ๋“ค๊ธฐ
  • ์•ฑ ๋ฐฐํฌ ์ž๋™ํ™”(์‹ฌ์‚ฌ๊นŒ์ง€)
  • ์ž๋™ํ™”๋œ ์ฝ”๋“œ ์„œ๋ช…
    • ex) ์„œ๋ช… ์ธ์ฆ์„œ๋ฅผ ํŒ€ ๊ฐ„์— ๊ณต์œ ํ•˜๊ณ  ๋™์ผํ•œ ํ”„๋กœ์ ํŠธ์—์„œ ๊ฐ™์€ ์ธ์ฆ์„œ๋กœ ๊ด€๋ฆฌ๋  ์ˆ˜ ์žˆ๊ฒŒ ํ•จ.(๋ฌด๋ ค ๊ฐฑ์‹ ๊นŒ์ง€ ํ•ด์คŒ)

์„ค์น˜ ๋ฐฉ๋ฒ•

  • Fastlane์„ ์œ„ํ•œ Xcode ์ปค๋งจ๋“œ๋ผ์ธ ํˆด์„ ์„ค์น˜

    xcode-select --install

  • fastlane์„ ์„ค์น˜

    brew install fastlane

ํ”„๋กœ์ ํŠธ ๋ณ„ fastlane ์„ค์ •ํ•˜๊ธฐ

์ฝ”์ฝ”์•„ํŒŸ์„ ํ”„๋กœ์ ํŠธ์— ์ ์šฉํ•˜๋Š” ๊ฒƒ๊ณผ ๋™์ผํ•˜๊ฒŒ fastlane๋„ ๋™์ผ

ํ”„๋กœ์ ํŠธ ์œ„์น˜์—์„œ ์•„๋ž˜ ๋ช…๋ น์–ด ์ž…๋ ฅ

fastlane init


์ถœ์ฒ˜

  1. ์ž๋™ํ™”๋œ ์Šคํฌ๋ฆฐ์ƒท ์˜ต์…˜
  2. ์ž๋™ํ™”๋œ TestFlight์— ๋ฒ ํƒ€ ์•ฑ ๋ฐฐํฌ
  3. ์ž๋™ํ™”๋œ ์•ฑ ๋ฐฐํฌ
  4. ์‚ฌ์šฉ์ž ์ž„์˜ ์˜ต์…˜

1, 2, 3์˜ ๊ฒฝ์šฐ ์œ„์— ์„ค๋ช…ํ•œ ๊ฐ€์žฅ ์ผ๋ฐ˜์ ์ธ ์ž๋™ํ™” ์˜ต์…˜์„ ์ œ๊ณตํ•˜๊ณ  4๋ฒˆ์„ ํ†ตํ•ด ์‚ฌ์šฉ์ž๊ฐ€ ์›ํ•˜๋Š” ์ž๋™ํ™”๋ฅผ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๋‹ค.

์˜ต์…˜์„ ์„ ํƒํ•˜๊ณ  ๋‚˜์„œ ์•ฑ์˜ ID, ๊ฐœ๋ฐœ์ž ์ •๋ณด๋ฅผ ์ž…๋ ฅํ•˜๊ฒŒ ๋˜๋ฉด fastlane ํด๋”๊ฐ€ ์ƒ์„ฑ๋œ๋‹ค.

ํ•ด๋‹น ํด๋” ๋‚ด๋ถ€์—๋Š” Appfile, Fastfile, Matchfile, Pluginfile์ด ๋“ค์–ด์žˆ๋‹ค.

  • ํŒŒ์ผ ๋ณ„ ์„ค๋ช…
    • Appfile์€ ์•ฑ์˜ ID, (iOS์˜ ๊ฒฝ์šฐ apple id, team id ๋“ฑ) ๋ฐฐํฌ์‹œ ํ•„์š”ํ•œ ํ™˜๊ฒฝ์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ๋ณด๊ด€ํ•˜๋Š” ํŒŒ์ผ๋กœ fastlane์€ ๋งค๋ฒˆ ์‹คํ–‰๋ ๋•Œ๋งˆ๋‹ค Appfile์— ๊ธฐ์ž…๋œ ๋‚ด์šฉ์„ ๋ณด๊ณ  ํ™˜๊ฒฝ์„ ์„ธํŒ…ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
    • Fastfile์€ fastlane์„ ํ†ตํ•ด ์–ด๋–ค ์ž‘์—…์„ ํ• ์ง€ โ€˜laneโ€™์„ ์ •์˜ํ•˜๋Š” ํŒŒ์ผ์ด๊ณ  ๊ฐ lane์€ ํ•ด๋‹น lane์ด ์–ด๋–ค โ€˜actionโ€™ ์„ ํ• ์ง€ ์ •์˜ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
    • Matchfile์€ ์›๊ฒฉ ์ €์žฅ์†Œ์—์„œ ๋ชจ๋“  ์ธ์ฆ์„œ๋ฅผ ๊ด€๋ฆฌํ•˜๋ ค๊ณ ์ž ํ• ๋•Œ ์ธ์ฆ์„œ์˜ ์ข…๋ฅ˜์™€ ์›๊ฒฉ์ €์žฅ์†Œ์˜ ์ฃผ์†Œ๋“ฑ์„ ์ž…๋ ฅํ•˜๋Š” ํŒŒ์ผ์ž…๋‹ˆ๋‹ค. Fastlane์˜ย [match](https://docs.fastlane.tools/actions/match/)ย ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.
    • Pluginfile์€ fastlane์˜ ๋ชจ๋“  ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ๊ด€๋ฆฌํ•˜๋Š” ํŒŒ์ผ์ž…๋‹ˆ๋‹ค.
    • ์™ ์•ฑ์˜ ๊ฒฝ์šฐย ios_build_and_uploadย ๋ผ๋Š” lane์—ย build_app()ย ๊ณผย firebase_app_distribution()ย ์ด๋ผ๋Š” fastlane์ด ์ œ๊ณตํ•˜๋Š” action์„ ์‚ฌ์šฉํ•˜์—ฌ iOS ์•ฑ์„ ๋นŒ๋“œํ•˜๊ณ  firebase์— ๋ฐฐํฌํ•˜๋„๋ก ์„ค์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
    • (์ถœ์ฒ˜: https://danawalab.github.io/common/2022/08/23/Fastlane.html)

fastlane์—์„œ ์ œ๊ณตํ•˜๋Š” action๋“ค

์ผ๋‹จ ๋ฐฐํฌ๋Š” ๋ฌด์‹œํ•˜๊ณ  apple Login๊ณผ ๊ฐ™์€ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๋Š” ๊ณ„์ •์˜ ๊ฐ™์€ ํ”„๋กœํŒŒ์ผ๋กœ ํŒ€์ด ๊ณต์œ ํ•ด์•ผํ•˜๋ฏ€๋กœ code Signing์„ ๊ณต์œ ํ•˜๋Š” Match๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์„ค๋ช…ํ•˜๊ฒ ๋‹ค! (MusicKit๋„ ์—ฌ๊ธฐ ํฌํ•จ๋˜๋ ค๋‚˜?)

Match์™€ cert and sigh ๋ฐฉ์‹

cert and sigh ๋ฐฉ์‹์ด๋ž€, ๋กœ์ปฌ์— ์ €์žฅ๋œ ์ธ์ฆ์„œ์™€ ๊ฐœ์ธ ํ‚ค๊ฐ€ ์žˆ๋Š” ์ง€ ํ™•์ธ ํ›„, ์ธ์ฆ์„œ์™€ ํ”„๋กœํŒŒ์ผ์„ ๋‹ค์šด๋ฐ›์•„์ฃผ๋Š” ๋ฐฉ์‹

Match ๋ฐฉ์‹์ด๋ž€, ์›๊ฒฉ์— ์ €์žฅ๋œ ์ธ์ฆ์„œ์™€ ๊ฐœ์ธ ํ‚ค๋ฅผ ํ™•์ธ ํ•ด ํ•ด๋‹น ๊ธฐ๊ธฐ์— ์ธ์ฆ์„œ์™€ ํ”„๋กœํŒŒ์ผ์„ ๋‹ค์šด๋ฐ›์•„ ์ฃผ๋Š” ๋ฐฉ์‹

์šฐ๋ฆฌ๋Š” ๋™์ผํ•œ ํ”„๋กœ์ ํŠธ์—์„œ ์ž‘์—…ํ•ด์•ผํ•˜๊ธฐ์— ๊ฐ๊ฐ์˜ ๋กœ์ปฌ์— ๊ฐ€์ง€๊ณ  ์žˆ๊ธฐ์—๋Š” ๋ฒˆ๊ฑฐ๋กœ์›€์œผ๋กœ Match ๋ฐฉ์‹์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž.

match ๋ฐฉ์‹ ์ ์šฉํ•˜๊ธฐ

https://ios-development.tistory.com/1164

์ด ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ๋Š” ์œ„์˜ ์‚ฌ์ดํŠธ๋ฅผ ์ œ๊ฐ€ ๋ณต๋ถ™ํ•  ๊ฒƒ๋งŒ ๊ฐ™์•„ ๋งํฌ๋กœ ๋‚จ๊ฒจ๋†“์•˜์Šต๋‹ˆ๋‹คโ€ฆ

์ถ”ํ›„์— ์ •๋ฆฌํ•ด์„œ ์ž‘์„ฑํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

์ฐธ์กฐ ๋งํฌ

[[CI/CD] fastlane + Github Actions์„ ์ด์šฉํ•œ iOS ๋ฐฐํฌ ์ž๋™ํ™” ๊ตฌ์ถ•](https://medium.com/@kyuchul2/ci-cd-fastlane-github-actions%EC%9D%84-%EC%9D%B4%EC%9A%A9%ED%95%9C-ios-%EB%B0%B0%ED%8F%AC-%EC%9E%90%EB%8F%99%ED%99%94-%EA%B5%AC%EC%B6%95-6c777a63aa13)

[iOS) Code Signing ๊ณผ Fastlane match ์„ค์ •](https://gyuios.tistory.com/272#google_vignette)

[[Fastlane] Fastlane Match ๋„์ž…ํ•ด๋ณด๊ธฐ (๊ณ„์†๋œ ์‚ฝ์งˆ)](https://ho8487.tistory.com/m/149)

[[fastlane] fastlane ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์‚ฌ์šฉ ๋ฐฉ๋ฒ• (.env.default ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ€์žฅ ๊ฐ„๋‹จํ•œ match ์‚ฌ์šฉ๋ฐฉ๋ฒ•, Certificate ๊ฐฑ์‹  ๋ฐฉ๋ฒ•)](https://ios-development.tistory.com/1164)

[Getting Started - fastlane docs](https://docs.fastlane.tools/codesigning/getting-started/)

[fastlane - App automation done right](https://fastlane.tools/)

[Fastlane์„ ์ด์šฉํ•œ ์•ฑ ์ž๋™ ๋ฐฐํฌ](https://danawalab.github.io/common/2022/08/23/Fastlane.html)

iOS07 ํ”„๋กœ์ ํŠธ ์ผ์ง€

๐Ÿ“š ๋ฌธ์„œ

๐Ÿซถ๐Ÿป ํŒ€ ๊ธฐ๋ก

๐ŸŽค ํ”„๋กœ์ ํŠธ

๐Ÿ’ก ํ•ต์‹ฌ ๊ฒฝํ—˜

๐Ÿšจ ํŠธ๋Ÿฌ๋ธ” ์ŠˆํŒ…

๐Ÿ“” ํ•™์Šต ์ •๋ฆฌ

๐Ÿช„ QA

Clone this wiki locally