有没有办法在我的 pod 编译之前每次都 运行 一个脚本文件?

Is there a way to run a script file every time before my pod is compiled?

我有一个写入文件的基本 swift 脚本。每次编译我的 cocoapods 库时,我都需要 运行 该脚本。

有办法吗?

在 podspec 文件中,您可以这样做:

 s.script_phase = { :name => 'Writing to files', :script => '(./myscript)', :execution_position => :before_compile }