module Pod class Target def self.set_archs(post_context, is_only_arm64) post_context.aggregate_targets.each do |one| one.pod_targets.each { |target| target.loop_set_archs(is_only_arm64) } one.set_archs(is_only_arm64) end end end class PodTarget def loop_set_archs(is_arm64) build_settings.each do |config_name, setting| config_file = setting.xcconfig if is_arm64 config_file.set_archs_arm64 else config_file.set_archs_default end config_path = xcconfig_path(config_name) config_file.save_as(config_path) end end end class AggregateTarget def set_archs(is_arm64) xcconfigs.each do |config_name, config_file| if is_arm64 config_file.set_archs_arm64 else config_file.set_archs_default end config_path = xcconfig_path(config_name) config_file.save_as(config_path) end end end end module Xcodeproj class Config def set_archs_default remove_attr_with_key('ARCHS') end def set_archs_arm64 @attributes['ARCHS'] = 'arm64' end end end