podfile 中 Hooks的详细使用

2022-08-15  本文已影响0人  我会回来的

例子 : Hooks 可实现  关闭所有target的Bitcode功能。

podfile 的使用如下:

platform : iOS,‘9.0’

target ‘TestCocoPods’ do 

 pod ‘你需要的三方库’

# 实现post_install Hooks 

post_install do |installer|  

#1 遍历项目的所有target 

    installer.pods_project.targets.each  do |target| 

#2 遍历build_configurations 

       target.build_configurations.each do |config|

#3 修改build_settings中的ENABLE_BITCODE 

           config.build_settings['ENABLE_BITCODE'] = 'NO'

         end

    end

end 

上一篇下一篇

猜你喜欢

热点阅读