关于Xcode新的构建系统(Xcode New Build System)导致Phase修改Info.plist不生效的问题

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值