TODO:待整理
关于Xcode新的构建系统(Xcode New Build System)导致Phase修改Info.plist不生效的问题
定位到是新的构建系统,做了优化,并行了,不保证phases在构建完成的最后执行。为了保证顺序,可以使用Input File,填
$(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)
另外,phases是顺序执行的。上面phase设置了依赖,下面就可以不设置了。不过保证独立性,最好都设置一下。
问题来了,为什么国内的msdk的不需要设置都可以保证顺序?msdk改info.plist之前,有其它phase需要依赖info.plist?
参考:
关于新的构建系统
https://blog.csdn.net/TuGeLe/article/details/84885211
解决方式就是为脚本设置好依赖关系,从而保证脚本执行在Target构建之后。我们知道,Process Info.plist过程会为.app文件生成Info.plst文件并进行初始化,我们可以将该文件设置为Run Script phases的Input Files,保证脚本的执行时间点在Info.plist更改之后,进而保证脚本的执行结果有效。
https://stackoverflow.com/questions/52524275/xcode-10-build-phase-shell-script
It seems like the problem is that sometimes your Run Script Phase will execute before Xcode creates the Info.plist. If you’d like to ensure that your script phase runs after a specific step, you need use the inputs to mark your dependencies.
For instance, adding:
$(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)
As an input to your script phase should enforce the ordering you are looking for: Xcode will create the Info.plist and sometime after, your script will execute and modify the Info.plist.