几周前为了尝试下SwiftUI_Metal,下载了Xcode15 beta版。后面尝试将Xcode14.2更新到Xcode14.3.1时,一直失败(估计是Mac上的BUG),索性就用Xcode15 beta版开发公司项目了。然而,beta终究是beta,还是有一些奇奇怪怪的问题(当然,也可能是Feature),这里先记录一下。
一、代码改动在模拟器不生效
Xcode15上第一次Command+R运行时,会报一些奇奇怪怪的错误,这时候,先选中 Any iOS Simulator Device(x86_64, arm64),Command+B编译一次之后,就能正常运行到模拟器上。然而没想到的是,后面的代码增删改之后,都得走这么一套流程,否则模拟器上跑的就还是改动之前的代码,原因未知。
二、Pods的某些Target报Info.plist缺失
使用Cocoapods管理依赖的项目,在编译时报下面这个错误:
error: Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically. Apply an Info.plist file to the target using the INFOPLIST_FILE build setting or generate one automatically by setting the GENERATE_INFOPLIST_FILE build setting to YES (recommended).
看描述,是说宿主依赖的Pods Target缺少了Info.plist,无法签名。啥?这里要校验签名了? 结合Xcode14中新增的对bundle的签名校验,苹果的这种操作好像也不奇怪。那就还是跟之前一样,强制跳过这个签名吧!具体操作是在Podfile中添加:
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = ‘NO'
# 或者按照提示修改下面这个配置项
# config.build_settings['GENERATE_INFOPLIST_FILE'] = ‘YES'
end
end
end
end