在Xcode升级到Xcode14以后,大家都发现系统的支持版本升级到了11.0,那么想要调试11.0之前的系统该怎么办呢
图1.png
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": [
"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": [
"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
添加 9.0-10.3 的版本 到以下节点中
SupportedTargets - iphoneos - ValidDeploymentTargets
DefaultProperties - DEPLOYMENT_TARGET_SUGGESTED_VALUES
如果没有包含,请把这个plist文件拷贝到桌面手动添加。添加完成后再粘贴到原来的位置。重启Xcode即可。
3.MinimumDeploymentTarget 改为9.0。(在SDKSettings.plist文件中搜MinimumDeploymentTarget)
配置文件拖出来到桌面 修改,完了覆盖进去
网友评论