Cocoapod hook pre_install post_install, before Cocoapod install and then how to do some other action

Click into the iOS experience to share tutorial series official website

在pod install 之前可以做一些其他处理的时候在pre_install里写脚本即可
pre_install do |installer|
    puts "pre install hook"
    Pod::UI.puts "pre install hook puts UI"
end

在pod install 之后可以做一些其他处理的时候在post_install里写脚本即可
post_install do |installer|
  puts "post install hook"
  exec 'pwd'
end

这俩hook方法还可以做一些其他语言脚本的执行,比如执行shell脚本,使用exec 后面跟上具体命令即可
sh命令文件是一样的
Released seven original articles · won praise 0 · Views 1125

Guess you like

Origin blog.csdn.net/huntaiji/article/details/104877596