Xcode 14.3版本运行项目报错
ld: file not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
因为系统已经内置有ARC
相关的库,所以没必要再额外链接,至少Xcode 14支持的最低部署目标iOS 11及以上版本的系统肯定是没问题的。如果应用部署目标不低于iOS 11还出现问题,那么应该是第三方库的部署目标有问题。
arc
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/
参考链接 https://blog.csdn.net/crasowas/article/details/129901398
在Xcode升级到Xcode14以后,大家都发现系统的支持版本升级到了11.0,那么想要调试11.0之前的系统该怎么办呢?
下边给大家介绍Xcode14调试11.0之前的系统的方法:
1.首先在Xcode14之前的版本下,应用程序-xcode 显示包内容 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport ,把程序中的低于11.0的文件夹拷贝到Xcode14的相应目录下。
2.在Xcode14下,应用程序-xcode 显示包内容 修改以下文件,记得修改前备份,防止改错无法还原.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.json
SDKSettings.json
{
"DisplayName": "iOS 16.4",
"DefaultProperties": {
"CODE_SIGN_ENTITLEMENTS": "",
"ENTITLEMENTS_REQUIRED": "YES",
"KASAN_DEFAULT_CFLAGS": "$(KASAN_CFLAGS_CLASSIC)",
"KASAN_DEFAULT_CFLAGS[arch=arm64]": "$(KASAN_CFLAGS_TBI)",
"KASAN_DEFAULT_CFLAGS[arch=arm64e]": "$(KASAN_CFLAGS_TBI)",
"DEAD_CODE_STRIPPING": "YES",
"GCC_THUMB_SUPPORT": "YES",
"TEST_LIBRARY_SEARCH_PATHS": "$(inherited) $(PLATFORM_DIR)\/Developer\/$(TEST_FRAMEWORK_DEVELOPER_VARIANT_SUBPATH)usr\/lib",
"SUPPORTED_DEVICE_FAMILIES": "1,2",
"PLATFORM_NAME": "iphoneos",
"KASAN_CFLAGS_CLASSIC": "-DKASAN=1 -DKASAN_CLASSIC=1 -fsanitize=address -mllvm -asan-globals-live-support -mllvm -asan-force-dynamic-shadow",
"CODE_SIGNING_REQUIRED": "YES",
"IPHONEOS_DEPLOYMENT_TARGET": "16.4",
"TEST_FRAMEWORK_SEARCH_PATHS": "$(inherited) $(PLATFORM_DIR)\/Developer\/$(TEST_FRAMEWORK_DEVELOPER_VARIANT_SUBPATH)Library\/Frameworks $(SDKROOT)\/Developer\/Library\/Frameworks",
"CODE_SIGN_IDENTITY": "Apple Development",
"KASAN_CFLAGS_TBI": "-DKASAN=1 -DKASAN_TBI=1 -fsanitize=kernel-hwaddress -mllvm -hwasan-recover=0 -mllvm -hwasan-instrument-atomics=0 -mllvm -hwasan-instrument-stack=1 -mllvm -hwasan-uar-retag-to-zero=1 -mllvm -hwasan-generate-tags-with-calls=1 -mllvm -hwasan-instrument-with-calls=1 -mllvm -hwasan-use-short-granules=0 -mllvm -hwasan-memory-access-callback-prefix=__asan_",
"ENTITLEMENTS_DESTINATION": "Signature",
"DEFAULT_COMPILER": "com.apple.compilers.llvm.clang.1_0",
"DEPLOYMENT_TARGET_SUGGESTED_VALUES": [
"8.0",
"8.1",
"8.2",
"8.3",
"8.4",
"9.0",
"9.1",
"9.2",
"9.3",
"10.0",
"10.1",
"10.2",
"10.3",
"15.1",
"15.3",
"15.6",
"15.7",
"16.2",
"11.0",
"11.1",
"11.2",
"11.3",
"11.4",
"12.0",
"12.1",
"12.2",
"12.3",
"12.4",
"13.0",
"13.1",
"13.2",
"13.3",
"13.4",
"13.5",
"13.6",
"14.0",
"14.1",
"14.2",
"14.3",
"14.4",
"14.5",
"14.6",
"14.7",
"15.0",
"15.1",
"15.2",
"15.3",
"15.4",
"15.5",
"15.6",
"16.0",
"16.1",
"16.2",
"16.3",
"16.4"
],
"AD_HOC_CODE_SIGNING_ALLOWED": "NO"
},
"MinimalDisplayName": "16.4",
"Version": "16.4",
"IsBaseSDK": "YES",
"SupportedTargets": {
"iphoneos": {
"LLVMTargetTripleVendor": "apple",
"DeploymentTargetSettingName": "IPHONEOS_DEPLOYMENT_TARGET",
"SwiftConcurrencyMinimumDeploymentTarget": "15.0",
"Archs": [
"arm64e",
"arm64"
],
"LLVMTargetTripleEnvironment": "",
"ClangRuntimeLibraryPlatformName": "ios",
"MaximumDeploymentTarget": "16.4.99",
"BuildVersionPlatformID": "2",
"DefaultDeploymentTarget": "16.4",
"LLVMTargetTripleSys": "ios",
"DeviceFamilies": [
{
"Identifier": "1",
"Name": "phone",
"DisplayName": "iPhone"
},
{
"Identifier": "2",
"Name": "pad",
"DisplayName": "iPad"
}
],
"MinimumDeploymentTarget": "11.0",
"SwiftOSRuntimeMinimumDeploymentTarget": "12.2",
"RecommendedDeploymentTarget": "12.5",
"PlatformFamilyName": "iOS",
"ValidDeploymentTargets": [
"8.0",
"8.1",
"8.2",
"8.3",
"8.4",
"9.0",
"9.1",
"9.2",
"9.3",
"10.0",
"10.1",
"10.2",
"10.3",
"15.1",
"15.3",
"15.6",
"15.7",
"16.2",
"11.0",
"11.1",
"11.2",
"11.3",
"11.4",
"12.0",
"12.1",
"12.2",
"12.3",
"12.4",
"13.0",
"13.1",
"13.2",
"13.3",
"13.4",
"13.5",
"13.6",
"14.0",
"14.1",
"14.2",
"14.3",
"14.4",
"14.5",
"14.6",
"14.7",
"15.0",
"15.1",
"15.2",
"15.3",
"15.4",
"15.5",
"15.6",
"16.0",
"16.1",
"16.2",
"16.3",
"16.4"
],
"SystemPrefix": ""
}
},
"PropertyConditionFallbackNames": [
"embedded"
],
"DefaultDeploymentTarget": "16.4",
"MaximumDeploymentTarget": "16.4.99",
"DebuggerOptions": {
"SupportsViewDebugging": "YES"
},
"CanonicalName": "iphoneos16.4",
"CustomProperties": {}
}
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist
添加 8.0-10.3 的版本 到以下节点中
SupportedTargets - iphoneos - ValidDeploymentTargets
DefaultProperties - DEPLOYMENT_TARGET_SUGGESTED_VALUES
如果没有包含,请把这个plist文件拷贝到桌面手动添加。添加完成后再粘贴到原来的位置。重启Xcode即可。
3.MinimumDeploymentTarget 改为8.0
配置文件拖出来到桌面 修改,完了覆盖进去
DeviceSupport下载地址: