Created
August 22, 2015 16:41
-
-
Save jaredsinclair/4de506e108249f39b12d to your computer and use it in GitHub Desktop.
Podfile post-install script for best-practice code signing settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post_install do |installer_representation| | |
installer_representation.pods_project.targets.each do |target| | |
target.build_configurations.each do |config| | |
if config.to_s == 'Beta' | |
config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = 'iPhone Distribution' | |
elsif config.to_s == 'Release' | |
config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = 'iPhone Distribution' | |
end | |
end | |
end | |
end |
Known Issue: It is not possible to specify a particular code signing identity when your project uses different distribution identities depending on the current scheme/config. Alas, we must fallback to trusting that Xcode will select the appropriate identity from the pool of distribution identities.
Shout out to @traviscrist for how to construct a post_install script this way. CocoaPods/CocoaPods#3811
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The default provisioning profile selection
Automatic
is acceptable so I leave that untouched.