티스토리 뷰

728x90

문제

 

라이브러리 설치할때마다 DEPLOYMENT_TARGET 버전이 변경되서

빌드를 할때마다 각 라이브러리의 타겟 버전을 변경해줘야 하는 번거로움이 있었습니다.

 

 

 

 

해결

Podfile에서 아래 내용을 추가해줍니다.

 

// 이 내용을 추가해주세요.

post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'  // <- 맞추고자 하는 버전
      end
    end
  end

 저는 iOS 11버전으로 지정했습니다. 

// Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '11.0'

target '프로젝트_이름' do
  # Comment the next line if you don't want to use dynamic frameworks

 use_frameworks!

  # Pods for 프로젝트_이름
pod 'RealmSwift'
pod 'Alamofire', '~> 5.4'
pod 'SnapKit', '~> 5.0.0'

// 여기 추가

post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'  // <- 맞추고자 하는 버전
      end
    end
  end

//

end

 

이렇게 하시고 터미널 -> 작업폴더(디렉토리)에서 pod install 을 해주시면 !!

ios target은 지정해놓은 버전으로 고정됩니다.

728x90