XCode14 & iOS16 适配问题汇总
amp 问题 汇总 适配 iOS16
2023-06-13 09:14:15 时间
1、不升级电脑系统与 Xcode,调试iOS 16
- 1、下载iOS16 Support文件
- 2、放置到Xcode DeviceSupport目录重启Xcode即可
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
2、iOS16手机开启开发者模式
iOS16手机未打开开发者模式时: 1、Xcode 无法选中 iOS16的设备,报错:developer mode disable 2、无法打开升级前编译的App
解决办法:打开调试手机-设置-隐私与安全-开发者模式-开启开发者模式(需要重启手机)
3、Pod工程中的Bundle target签名报错
- 方法一:手动选择Pod工程中的Bundle target 签名中的Team,与主工程一致
- 方法二:在Podfile脚本中设置你的开发者的Team ID
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
end
end
end
end
方法三:在Podfile脚本中设置CODE_SIGN_IDENTITY
为空来避免报错,这是目前在用的,也是最简单的方法
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_SIGN_IDENTITY'] = ''
end
end
end
end
4、iOS16 横竖屏切换适配
5、Xcode14运行项目在模拟器上报如下错误:
Thread 1: "[<_UINavigationBarContentViewLayout 0x7fd1a090d730> valueForUndefinedKey:]: this class is not key value coding-compliant for the key inlineTitleView."
打开全局断点就会出现这个报错,虽然不会闪退,但是很影响调试,是Xcode的bug,但是还没有修复,找到两个比较好的办法:
- 方法一:在全局断点上添加下面的条件
!(BOOL)[(id)[$arg1 reason] containsString:@"_UINavigationBarContentViewLayout"]
- 方法二:添加下面代码到工程,并在启动之后马上调用
#import <objc/runtime.h>
@interface Xcode14Fixer : NSObject
@end
@implementation Xcode14Fixer
+ (void)load
{
Class cls = NSClassFromString(@"_UINavigationBarContentViewLayout");
SEL selector = @selector(valueForUndefinedKey:);
Method impMethod = class_getInstanceMethod([self class], selector);
if (impMethod) {
class_addMethod(cls, selector, method_getImplementation(impMethod), method_getTypeEncoding(impMethod));
}
}
- (id)valueForUndefinedKey:(NSString *)key
{
return nil;
}
@end
相关文章
- 【补贴策略】用户质量&用户价值&用户成本的ROI提升
- pytorch笔记:04)resnet网络&解决输入图像大小问题「建议收藏」
- 『热门研究与论文发表系列研讨会』<第七期>回顾:牛津大学出版社 + 科研数据管理&发表策略
- 逻辑与(&&)、逻辑或(||)、按位与(&)、按位或(|)、按位异或(^)、按位取反(~)
- Yarn & NPM
- Tomcat&Servlet笔记
- Caddy & GRPC 端口复用配置
- 00SEC-D&D数据泄露报警日报【第7期】
- 杂记随笔:唤醒丢失问题 & 条件变量 vs 信号量
- Gitlab配置webhook趟坑全纪录&由此引发的常见环境问题排查思路与思考总结
- 用javascript分类刷leetcode16.set&map(图文视频讲解)_2023-03-01
- WPF 窗口居中 & 变更触发机制
- ECCV2022 &CVPR2022论文速递2022.7.20!& demo
- Flink中的数据抽象&交换&Credit&背压问题详解
- LinuxGUI自动化测试框架搭建-总体需求&详细设计&框架设计