美文网首页iOS开发
Xcode 14 兼容 旧设备 ios8.0 - ios11

Xcode 14 兼容 旧设备 ios8.0 - ios11

作者: 星星326 | 来源:发表于2022-09-21 09:21 被阅读0次

    在Xcode升级到Xcode14以后,大家都发现系统的支持版本升级到了11.0,那么想要调试11.0之前的系统该怎么办呢?

    下边给大家介绍Xcode14调试11.0之前的系统的方法:

    截屏2022-09-15 09.55.56.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.0",
        "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.0",
            "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",
                "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",
                "15.7",
                "16.0",
                "16.1"
            ],
            "AD_HOC_CODE_SIGNING_ALLOWED": "NO"
        },
        "MinimalDisplayName": "16.0",
        "Version": "16.0",
        "IsBaseSDK": "YES",
        "SupportedTargets": {
            "iphoneos": {
                "LLVMTargetTripleVendor": "apple",
                "DeploymentTargetSettingName": "IPHONEOS_DEPLOYMENT_TARGET",
                "SwiftConcurrencyMinimumDeploymentTarget": "15.0",
                "Archs": [
                    "arm64e",
                    "arm64"
                ],
                "LLVMTargetTripleEnvironment": "",
                "ClangRuntimeLibraryPlatformName": "ios",
                "MaximumDeploymentTarget": "16.0.99",
                "BuildVersionPlatformID": "2",
                "DefaultDeploymentTarget": "16.0",
                "LLVMTargetTripleSys": "ios",
                "DeviceFamilies": [
                    {
                        "Identifier": "1",
                        "Name": "phone",
                        "DisplayName": "iPhone"
                    },
                    {
                        "Identifier": "2",
                        "Name": "pad",
                        "DisplayName": "iPad"
                    }
                ],
                "MinimumDeploymentTarget": "8.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",
                    "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",
                    "15.7",
                    "16.0",
                    "16.1"
                ],
                "SystemPrefix": ""
            }
        },
        "PropertyConditionFallbackNames": [
            "embedded"
        ],
        "DefaultDeploymentTarget": "16.0",
        "MaximumDeploymentTarget": "16.0.99",
        "DebuggerOptions": {
            "SupportsViewDebugging": "YES"
        },
        "CanonicalName": "iphoneos16.0",
        "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下载地址:

    https://github.com/iGhibli/iOS-DeviceSupport

    链接:https://www.jianshu.com/p/1fab8881f08a

    相关文章

      网友评论

        本文标题:Xcode 14 兼容 旧设备 ios8.0 - ios11

        本文链接:https://www.haomeiwen.com/subject/ueliortx.html