Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경

836 views

Published on

LetSwift 2017 발표자료, 비바리퍼블리카에서 만드는 송금 금융앱 토스 iOS 앱의 개발 및 배포 환경입니다.

저희는 xcconfig, private cocoapods, fastlane 을 이용하고 있습니다.

Published in: Software
  • Be the first to comment

LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경

  1. 1. letswift(17) / 손민탁
  2. 2. letswift(17)
  3. 3.
  4. 4. .xcodeproj .xcworkspace.xcscheme
  5. 5. .xcodeproj .xcworkspace.xcscheme
  6. 6. 
 

  7. 7. 
 

  8. 8.
  9. 9.
  10. 10.
  11. 11. 
 
 ✕
  12. 12. 
 
 ✕ ✕
  13. 13. 
 
 ✕ ✕ ✕ ✕
  14. 14. 
 
 ✕ ✕ ✕ ✕
  15. 15. 
 
 ✕ ✕ ✕ ✕
  16. 16.
  17. 17. 
 

  18. 18. 
 
 

  19. 19. 
 
 

  20. 20. .xcschemetarget
  21. 21. .xcschemetarget
  22. 22. .xcconfig
  23. 23. .xcconfig
  24. 24. .xcconfig
  25. 25. .xcconfig
  26. 26.
  27. 27. 😴 🤓 💻
  28. 28.
  29. 29. 
 

  30. 30.
  31. 31.
  32. 32.
  33. 33.
  34. 34. target
  35. 35.
  36. 36.
  37. 37.
  38. 38. .xcodeproj .xcconfig
  39. 39. .xcodeproj .xcconfig
  40. 40. .xcodeproj .xcconfig BuildSettingExtractor
  41. 41. .xcodeproj BuildSettingExtractor
  42. 42. .xcodeproj BuildSettingExtractor
  43. 43. Project-Shared.xcconfig
  44. 44. Project-Release.xcconfigProject-Shared.xcconfig
  45. 45. Project-Release.xcconfigProject-Shared.xcconfig
  46. 46. Project- Shared.xcconfig Project-
 Debug.xcconfig Project
 Debug_guard.xcconfig Project-
 Release.xcconfig Project- Release_guard.xcconfig
  47. 47. Project- Shared.xcconfig Project-
 Debug.xcconfig Project
 Debug_guard.xcconfig Project-
 Release.xcconfig Project- Release_guard.xcconfig Trust- Shared.xcconfig Trust-
 Debug.xcconfig Trust
 Debug_guard.xcconfig Trust-
 Release.xcconfig Trust- Release_guard.xcconfig
  48. 48. Project- Shared.xcconfig Project-
 Debug.xcconfig Project
 Debug_guard.xcconfig Project-
 Release.xcconfig Project- Release_guard.xcconfig Trust- Shared.xcconfig Trust-
 Debug.xcconfig Trust
 Debug_guard.xcconfig Trust-
 Release.xcconfig Trust- Release_guard.xcconfig 

  49. 49. 
 
 ✕ ✕ ✕ ✕
  50. 50. Trust-AppStore-Debug.xcconfig
  51. 51. Trust-AppStore-Debug.xcconfig Trust-AppStore-Development-Team.xcconfig
  52. 52. Trust-AppStore-Debug.xcconfig Trust-Debug.xcconfig
  53. 53. Trust-AppStore-Debug.xcconfig 
 

  54. 54. Trust-AppStore-Debug.xcconfig 

  55. 55. 
 

  56. 56. 
 
 

  57. 57.
  58. 58. OTHER_LDFLAGS -ObjC -force_load -lz LIBRARY_SEARCH_PATHS… OTHER_LDFLAGS -lc++ -lz LIBRARY_SEARCH_PATHS… OTHER_LDFLAGS -lstdc++ -lsqlite3 LIBRARY_SEARCH_PATHS… OTHER_LDFLAGS -framework CoreMedia LIBRARY_SEARCH_PATHS… 

  59. 59. OTHER_LDFLAGS -ObjC -force_load -lz LIBRARY_SEARCH_PATHS… OTHER_LDFLAGS -lc++ -lz LIBRARY_SEARCH_PATHS… OTHER_LDFLAGS -lstdc++ -lsqlite3 LIBRARY_SEARCH_PATHS… OTHER_LDFLAGS -framework CoreMedia LIBRARY_SEARCH_PATHS… 

  60. 60. 😴 🤓 💻
  61. 61. $ cd ~/Documents # 1. SDK podspec # git . # e.g. https://github.com/toss/toss-3rd-sdk-test $ pod lib create 'toss-3rd-sdk-test'
  62. 62. $ cd ~/Documents # 1. SDK podspec # git . # e.g. https://github.com/toss/toss-3rd-sdk-test $ pod lib create 'toss-3rd-sdk-test'
  63. 63. # 2. podspec $ cd toss-3rd-sdk-test $ vi toss-3rd-sdk-test.podspec
  64. 64. Pod::Spec.new do |s| s.name = 'toss-3rd-sdk-test' s.version = ‘0.1.0' s.summary = ‘ ' s.description = <<-DESC X DESC s.homepage = 'https://github.com/toss/toss-3rd-sdk-test' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'Mintak Son' => 'mintakson@toss.im' } s.source = { :git => 'https://github.com/toss/toss-3rd-sdk-test.git', :tag => s.version.to_s } s.ios.deployment_target = '8.0' s.requres_arc = true # … # 2. podspec $ cd toss-3rd-sdk-test $ vi toss-3rd-sdk-test.podspec
  65. 65. # … # s.source_files = 'Library/**/*.h' # s.vendored_libraries = 'Library/lib/*.a' # s.resource_bundles = {} # s.frameworks = 'AVFoundation', 'CoreMotion', 'CoreLocation' # s.public_header_files = 'Library/include/*.h' s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' } s.library = 'z', 'c++' end
  66. 66. # … # s.source_files = 'Library/**/*.h' # s.vendored_libraries = 'Library/lib/*.a' # s.resource_bundles = {} # s.frameworks = 'AVFoundation', 'CoreMotion', 'CoreLocation' # s.public_header_files = 'Library/include/*.h' s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' } s.library = 'z', 'c++' end # 3. # podspec tag $ git commit -m ' 0.1.0' $ git tag 0.1.0
  67. 67. # 4. private pod repo # private pod repo git . # e.g. git@github.com:toss/private-pod-repo.git # pod repo add REPO_NAME SOURCE_URL $ pod repo add private-pod-repo git@github.com:toss/private-pod-repo.git
  68. 68. # 4. private pod repo # private pod repo git . # e.g. git@github.com:toss/private-pod-repo.git # pod repo add REPO_NAME SOURCE_URL $ pod repo add private-pod-repo git@github.com:toss/private-pod-repo.git # 5. SDK private pod repo . # pod repo push REPO_NAME PODSPEC_FILE $ pod repo push private-pod-repo toss-3rd-sdk-test.podspec
  69. 69. # 4. private pod repo # private pod repo git . # e.g. git@github.com:toss/private-pod-repo.git # pod repo add REPO_NAME SOURCE_URL $ pod repo add private-pod-repo git@github.com:toss/private-pod-repo.git # 5. SDK private pod repo . # pod repo push REPO_NAME PODSPEC_FILE $ pod repo push private-pod-repo toss-3rd-sdk-test.podspec # 6. $ cd ~/.cocoapods/repos/private-pod-repo $ ls toss-3rd-sdk-test $ tree . └── toss-3rd-sdk-test └── 0.1.0 └── toss-3rd-sdk-test.podspec
  70. 70. # 7. Podfile $ cd ~/Documents/myproject/ $ vi Podfile
  71. 71. # 7. Podfile $ cd ~/Documents/myproject/ $ vi Podfile platform :ios, '8.0' source 'https://github.com/CocoaPods/Specs.git' source 'git@github.com:toss/toss-ios-private-pod-repo.git' # ... ... def app_pods # ... ... pod 'toss-3rd-test-sdk' # ... ... end # ... ...
  72. 72. # 7. Podfile $ cd ~/Documents/myproject/ $ vi Podfile platform :ios, '8.0' source 'https://github.com/CocoaPods/Specs.git' source 'git@github.com:toss/toss-ios-private-pod-repo.git' # ... ... def app_pods # ... ... pod 'toss-3rd-test-sdk' # ... ... end # ... ... # 8. $ pod update # or pod install
  73. 73. 
 
 

  74. 74.
  75. 75. 
 
 
 
 
 
 
 

  76. 76. 
 
 
 

  77. 77. 😴 🤓 💻
  78. 78. $ fastlane pem 

  79. 79. $ fastlane pem 

  80. 80. $ fastlane pem # fastlane pem -a APP_BUNDLE_ID -u APPLE_ACCOUNT_EMAIL -p P12_PASSWORD $ fastlane pem -a com.vivarepublica.toss -u 'mintakson@toss.im' -p 'PA55W0RD!@#' 

  81. 81.
  82. 82. 
 
 

  83. 83. 
 

  84. 84. 
 

  85. 85. 
 
 $ fastlane match init --git_url git@github.com:toss/toss-ios-certificate.git --git_branch appstore_account --username build-bot@toss.im --app_identifier ...
  86. 86. 
 
 $ fastlane match init --git_url git@github.com:toss/toss-ios-certificate.git --git_branch appstore_account --username build-bot@toss.im --app_identifier ... # Matchfile git_url "git@github.com:toss/toss-ios-certificate.git" username "build-bot@toss.im” git_branch "appstore_account"
  87. 87. 
 
 $ fastlane match appstore
  88. 88. 
 
 $ fastlane match appstore 

  89. 89. 
 

  90. 90. 
 

  91. 91. 
 
 $ fastlane match $ fastlane match $ fastlane match
  92. 92. 
 
 $ fastlane match $ fastlane match $ fastlane match 

  93. 93. 
 
 $ fastlane match $ fastlane match $ fastlane match 

  94. 94. 
 
 $ fastlane match $ fastlane match $ fastlane match 

  95. 95. 
 $ fastlane ios match_appstore # / $ fastlane ios dogspaw # adhoc $ fastlane ios alpha # adhoc $ fastlane ios staging # adhoc $ fastlane ios prod # adhoc
  96. 96. 
 $ fastlane ios match_appstore # / $ fastlane ios dogspaw # adhoc $ fastlane ios alpha # adhoc $ fastlane ios staging # adhoc $ fastlane ios prod # adhoc $ fastlane ios match_appstore readonly:false # / $ fastlane ios prod export_method:app-store # $ fastlane ios alpha crashlytics:true # adhoc fabric beta $ fastlane ios staging crashlytics:true emails:mintakson@toss.im,y8k@toss.im # adhoc fabric beta $ fastlane ios staging crashlytics:true tester_groups:shinhan_investment # adhoc fabric beta shinhan_investment
  97. 97. 
 $ fastlane ios match_appstore # / $ fastlane ios dogspaw # adhoc $ fastlane ios alpha # adhoc $ fastlane ios staging # adhoc $ fastlane ios prod # adhoc $ fastlane ios match_appstore readonly:false # / $ fastlane ios prod export_method:app-store # $ fastlane ios alpha crashlytics:true # adhoc fabric beta $ fastlane ios staging crashlytics:true emails:mintakson@toss.im,y8k@toss.im # adhoc fabric beta $ fastlane ios staging crashlytics:true tester_groups:shinhan_investment # adhoc fabric beta shinhan_investment
  98. 98. 
 $ fastlane init # .
  99. 99. 
 $ fastlane init # .
  100. 100. 
 for_lane :dogspaw do app_identifier "com.vivarepublica.cash.dogspaw" apple_id "build-bot@toss.im" team_id "…" end for_lane :alpha do app_identifier "com.vivarepublica.cash.alpha" apple_id "build-bot@toss.im" team_id "…" end for_lane :staging do app_identifier "com.vivarepublica.cash.staging" apple_id "build-bot@toss.im" team_id "…" end #... ...
  101. 101. 
 # pseudo-Fastfile. -Fastfile. platform :ios do before_all do ensure_git_status_clean clear_derived_data end lane :match_appstore do |options| match(git_branch: "appstore_account", type: "adhoc", readonly: readonly) match(git_branch: "appstore_account", type: "appstore", readonly: readonly) end
  102. 102. 
 lane :prod do |options| match_appstore cocoapods(repo_update: true) gym(...) crashlytics(...) slack(...) end after_all do |lane| reset_git_repo(disregard_gitignore: false) end error do |lane, exception| reset_git_repo(disregard_gitignore: false) slack(...) end end
  103. 103.
  104. 104. letswift(17)

×