Cocoapods optimization level for schemes
cocoapods, ios, xcode
Solution
I use post_install hook in Podfile. Like this:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
if config.name.include?("Debug")
config.build_settings['GCC_OPTIMIZATION_LEVEL'] = '0'
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
end
end
end
EDIT `GCC_OPTIMIZATION_LEVEL` is ignored for Swift Pods. If you're using Swift Pods you also need to set `SWIFT_OPTIMIZATION_LEVEL`.
Problem
Looking at the project file for Cocoapods `Pods.xcodeproj` it looks like every single scheme for every library (except for `Debug` scheme) has an optimization level of `Fastest, Smallest`. Is there a quick and easy way to change the `Podfile` or some other configuration of Cocoapods so that the optimization level is `None` for specific schemes when I use `pod install`?