谢谢,@霍德森,这是解决方案。略有documentation修改的例子中,我们得到
post_install do |installer|
#Specify what and where has to be added
targetName = 'Mixpanel'
settingKey = 'DISABLE_MIXPANEL_AB_DESIGNER'
settingValue = 1
#Find the pod which should be affected
targets = installer.pods_project.targets.select { |target| target.name == targetName }
target = targets[0]
#Do the job
target.build_configurations.each do |config|
config.build_settings[settingKey] = settingValue
end
end
就在这个代码添加到您的podfile。显然,用同样的方法你可以对自动生成的pod项目进行任何更改,并且它们不会丢失。
来源
2017-08-15 09:39:19
nrx
可以在这里使用'post_install'钩子吗? https://guides.cocoapods.org/syntax/podfile.html#post_install – Hodson
@Hodson的确,它可以:)我已经根据您的评论发布了一个答案。 – nrx