謝謝,@霍德森,這是解決方案。略有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