Xcode|Xcode 10、iOS 12、iPhone X系列的适配与总结

1、libstdc++相关的3个库(libstdc++、libstdc++.6、libstdc++.6.0.9)在XCode10和iOS12中被移除

错误描述: ld: library not found for -lstdc++.6.0.9 linker command failed with exit code 1(use -v to see invocation)

解决办法一:删除libstdc++,编译无错则不用适配,否则参考方法二
解决办法二:拷贝缺失的libstdc++
从XCode 9的目录里,把缺失的.tbd文件拷贝过来,要记得拷贝2套,一套是模拟器的,一套是真机的,文件路径如下:
真机:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib模拟器:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib

2、与第三方的info.plist文件冲突
错误描述: Showing Recent Messages :-1: Multiple commands produce '/Users/wzm/Library/Developer/Xcode/DerivedData/MMC_SchoolShip-clbdywlcrnuhghgjrqctfnobowcr/Build/Products/Debug-iphoneos/MMC_SchoolShip.app/Info.plist': 1) Target 'MMC_SchoolShip' (project 'MMC_SchoolShip') has copy command from '/Users/wzm/Documents/MMC_SchoolShip/MMC_SchoolShip/MMVC/SCHChat/Vender/MJExtension/Info.plist' to '/Users/wzm/Library/Developer/Xcode/DerivedData/MMC_SchoolShip-clbdywlcrnuhghgjrqctfnobowcr/Build/Products/Debug-iphoneos/MMC_SchoolShip.app/Info.plist' 2) Target 'MMC_SchoolShip' (project 'MMC_SchoolShip') has copy command from '/Users/wzm/Documents/MMC_SchoolShip/MMC_SchoolShip/MMVC/SCHChat/Vender/Masonry/Info.plist' to '/Users/wzm/Library/Developer/Xcode/DerivedData/MMC_SchoolShip-clbdywlcrnuhghgjrqctfnobowcr/Build/Products/Debug-iphoneos/MMC_SchoolShip.app/Info.plist' 3) Target 'MMC_SchoolShip' (project 'MMC_SchoolShip') has process command with output '/Users/wzm/Library/Developer/Xcode/DerivedData/MMC_SchoolShip-clbdywlcrnuhghgjrqctfnobowcr/Build/Products/Debug-iphoneos/MMC_SchoolShip.app/Info.plist'

解决办法一:将第三方的info.plist删除
解决办法二:将第三方的info.plist文件重命名且保持唯一
解决办法三:如以上方法出错,参考下图设置Xcode

Xcode|Xcode 10、iOS 12、iPhone X系列的适配与总结
文章图片
第一步
Xcode|Xcode 10、iOS 12、iPhone X系列的适配与总结
文章图片
第二步 3、项目图标和启动图的调整 Xcode 10如何合理的设置『项目图标』和『启动图』
推荐一款快速生成项目图标的工具:APRO
App Store内搜索下载或点击下载链接
将生成的图片和Contents.json文件全部拖到对应的文件夹下,即可自动替换。
4、新版屏幕适配
#define IS_iPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) #define SCREEN_SCALE[UIScreen mainScreen].scale #define SCREEN_HEIGHT[UIScreen mainScreen].bounds.size.height #define iPhoneX(IS_iPhone && SCREEN_HEIGHT>=812)//iPhoneX系列 #define iPhone_5_8 (IS_iPhone && SCREEN_HEIGHT==812)//5.8寸 #define iPhone_6_1 (IS_iPhone && SCREEN_HEIGHT==896 && SCREEN_SCALE==2.0)//6.1寸 #define iPhone_6_5 (IS_iPhone && SCREEN_HEIGHT==896 && SCREEN_SCALE==3.0)//6.5寸

5、自定义创建.framework时的bug修复 【Xcode|Xcode 10、iOS 12、iPhone X系列的适配与总结】Xcode 10创建.framework库文件

    推荐阅读