Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CocoaPods post_install step for changing Build Active Architecture Only from Yes to No.
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |configuration|
target.build_settings(configuration.name)['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end
@funroll
Copy link
Author

funroll commented Jun 22, 2014

I also found this post_install step helpful.

post_install do |installer_representation|
  installer_representation.project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ARCHS'] = 'armv7 armv7s'
    end
  end
end

@dbrisinda
Copy link

dbrisinda commented Jul 5, 2014

This is an improved version that combines the above two versions and works for Xcode 5.1.1. Based on the (updated) original by Cameron Spickert.

# Remove 64-bit build architecture from all pod targets and override 'Build Active Architecture Only' to NO.
post_install do |installer|
  installer.project.targets.each do |target|
    target.build_configurations.each do |configuration|
      target.build_settings(configuration.name)['VALID_ARCHS'] = '$(ARCHS_STANDARD_32_BIT)'
      target.build_settings(configuration.name)['ONLY_ACTIVE_ARCH'] = 'NO'
    end
  end
end

@funroll
Copy link
Author

funroll commented Jul 9, 2014

@dbrisinda Thanks for that version--handy to have both in one!

@nickjbauer
Copy link

nickjbauer commented Jan 21, 2016

Updated for more recent: cocoapods 0.39.0 (unsure what other versions it supports).

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
target.build_settings(configuration.name)['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end

@peterjenkins
Copy link

peterjenkins commented Jun 17, 2016

@nickjbauer Thanks for the update, that works with CocoaPods 1.0 as well.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |configuration|
      target.build_settings(configuration.name)['ONLY_ACTIVE_ARCH'] = 'NO'
    end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment