0
0

More than 3 years have passed since last update.

CocoaPods で追加するライブラリの Deployment Target を書き換える

Last updated at Posted at 2020-10-05

Xcode 12 から Deployment Target が iOS 9 以上になりました。CocoaPods で追加するライブラリにも適用され、iOS 9 未満をサポートするものがあれば、適宜アップデートが必要になります。しかしながら、すべてのライブラリが対応済みではない事態も考えられます。その場合は Podfile でライブラリそれぞれの Deployment Target を 9 以上になるように書き換えます。

Podfile
def change_deployment_target_for_xcode12(installer)
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
      end
    end
  end
end

target 'app' do        
  # ...
  post_install do |installer|
+   change_deployment_target_for_xcode12(installer)
  end
end

if により既に対応済みのライブラリならば、影響しないようにしています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0