#iOS笔记#podfile文件

简介

pofile是一个Ruby文件,也可以使用json文件(podfile.json)

podfile hook

添加build_settings

installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||=['$(inherited)','LOG_ENABLED=1']
    end
end

这样做可以为修改PREPROCESSOR,添加想要的预编译宏,例如打印日志的宏

预编译宏添加.png

模拟器arm64

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    # 添加arm64架构
    if config.name == 'Release' then
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end
end

不用每次打静态库都去添加arm64

更多书写姿势

http://guides.cocoapods.org/using/the-podfile.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。