관리 메뉴

김종권의 iOS 앱 개발 알아가기

[iOS - swift] Rugby 프레임워크, COCOAPODS_PARALLEL_CODE_SIGN, Indexing 속도, Cocoapods 빌드 속도 올리기 본문

빌드 환경 설정

[iOS - swift] Rugby 프레임워크, COCOAPODS_PARALLEL_CODE_SIGN, Indexing 속도, Cocoapods 빌드 속도 올리기

jake-kim 2021. 12. 19. 23:20

Rugby란?

  • Rugby 프레임워크 - 캐싱 툴
    • Pods Targets에 존재하는 불필요한 Indexing 최적화 (캐싱)
    • Cocoapods에 rebuild 시간을 줄여주는 효과
  • Rugby 원리
    • 모든 pods에 관한 dependeny들을 캐싱하고, 그 dependency가 있는 Pods 프로젝트로 부터 targets들을 삭제
    • pods이 변경될때만 rebuild되게끔 설정
    • 불필요한 source를 삭제하여 project 사이즈 감소
  • 직접 Rugby 실행 결과
    • 프로젝트 사이즈 93% 감소
    • 인덱싱 파일 개수 99% 감소
    • Targets 개수 93% 감소

Rugby 실행 결과

Rugby 사용 사전 준비

  • mint 패키지 관리 도구 설치 및 Mintfile 생성
  • Mintfile에 Rugby 설치를 위해 아래 코드 기입
    wotjd/rugby@use-pods-configuration-build-dir
  • 설치
    cd/to/project
    mint bootstrap​
  • pod install에서 rugby 사용
    pod install && mint run rugby -s ios -c Debug
    pod install && mint run rugby -s ios -c Release​
적용 전 - Pods 디렉토리 존재 적용 후 - Pods 디렉토리 삭제

Cocoapods 빌드 속도 줄이기

  • 보안을 위해 Apple 기기는 서명된 코드만 실행되는데, (code sign) 여기서 많은 시간을 잡아먹으며 빌드 속도가 느려지는점이 존재
  • 병렬적으로 Pods에 존재하는 코드들을 sign하도록 기능을 활성화 (cocoapods 버전 1.2.0부터 적용 가능)
  • Project Target에 User-defined로 다음 값을 추가

Add User-Defined Setting 선택

Key: COCOAPODS_PARALLEL_CODE_SIGN

value: true

 

* 참고

https://alexanderpaterson.com/posts/cocoapods-introduces-parallel-codesigning-enable-now

https://swiftyfinch.github.io/en/2021-03-09-rugby-story/

https://github.com/swiftyfinch/Rugby

Comments