module Pod class Target def self.excluded_archs_simulator(post_context, is_arm64) post_context.aggregate_targets.each do |one| one.pod_targets.each { |target| target.excluded_archs_simulator(is_arm64) } one.excluded_archs_simulator(is_arm64) end end end class PodTarget def excluded_archs_simulator(is_arm64) build_settings.each do |config_name, setting| config_file = setting.xcconfig if is_arm64 config_file.set_excluded_archs_simulator else config_file.set_excluded_archs_simulator_default end config_path = xcconfig_path(config_name) config_file.save_as(config_path) end end end class AggregateTarget def excluded_archs_simulator(is_arm64) xcconfigs.each do |config_name, config_file| if is_arm64 config_file.set_excluded_archs_simulator else config_file.set_excluded_archs_simulator_default end config_path = xcconfig_path(config_name) config_file.save_as(config_path) end end end end module Xcodeproj class Config def set_excluded_archs_simulator_default remove_attr_with_key('EXCLUDED_ARCHS[sdk=iphonesimulator*]"') end def set_excluded_archs_simulator @attributes["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = 'arm64' end end class Project def self.set_archs_arm64(post_context, is_arm64) temp_project = post_context.umbrella_targets.first.user_project temp_project.targets.each do | target | build_configurations = target.build_configurations build_configurations.each do | config | config.set_archs(is_arm64) end end temp_project.save end module Object class XCBuildConfiguration def set_archs(is_arm64) if is_arm64 build_settings['ARCHS'] = "arm64" else build_settings['ARCHS'] = "$(ARCHS_STANDARD)" end end end end end end