有关将新 iOS 设备的屏幕参数添加到 Cardboard SDK 的说明
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
每年都会发布新的 iOS 设备。为了让 Cardboard SDK 与这些新设备配合使用,必须更新 screen_params.mm。
需要更新的内容
请查看 screen_params 的历史记录,确保会更新正确的行。
使用新的屏幕参数文件更新 XR 插件
如果正在使用 XR 插件,则需要使用更新后的 screen_params.mm
文件生成新的 GfxPluginCardboard.a
。
按照快速入门中的“下载并构建演示版应用”部分中前 2 步中的步骤操作,在 Xcode 中打开 Cardboard.xcworkspace
工作区。选择 SDK 模块,然后选择 Generic iOS Device(通用 iOS 设备)作为目标设备(或者选择针对特定手机构建,如果这样可以更好地满足您的需求)。构建 SDK 模块,复制生成的 .a
文件,并替换 cardboard-xr-plugin/Runtime/iOS/ 中的 GfxPluginCardboard.a
文件。
保留所有权利。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eYearly updates to \u003ccode\u003escreen_params.mm\u003c/code\u003e are necessary for Cardboard SDK compatibility with new iOS devices.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers need to obtain model strings and DPI values from sources like theapplewiki.com and Apple's official specifications.\u003c/p\u003e\n"],["\u003cp\u003eThe XR Plugin requires regeneration of \u003ccode\u003eGfxPluginCardboard.a\u003c/code\u003e using the updated \u003ccode\u003escreen_params.mm\u003c/code\u003e file for proper functionality.\u003c/p\u003e\n"],["\u003cp\u003eUpdating involves building the SDK module in XCode with a generic or specific iOS device target, then replacing the existing \u003ccode\u003eGfxPluginCardboard.a\u003c/code\u003e within the cardboard-xr-plugin.\u003c/p\u003e\n"]]],[],null,["# Instructions to add the screen params of new iOS devices to the Cardboard SDK\n\nEach year, new iOS devices are released. In order to make the Cardboard SDK\nwork with these new devices, it is required to update [screen_params.mm](https://github.com/googlevr/cardboard/blob/master/sdk/screen_params/ios/screen_params.mm).\n\nSource of information\n---------------------\n\n- Model strings can be obtained from \u003chttps://theapplewiki.com/wiki/Models\u003e.\n- DPI (also called PPI) value can be taken from Apple's technical specifications. For example, for iPhone 15 \u003chttps://www.apple.com/iphone-15/specs/\u003e.\n\nWhat needs to be updated\n------------------------\n\nTake a look at the [history of screen_params](https://github.com/googlevr/cardboard/commit/5c9f3066dc14962d1dec9a32ec9d3668641c408d#diff-df9ac93ac73eb84593606cffc684fb9640e704a3e6fda96ca9cf42340a81c78a)\nto ensure that the correct lines are being updated.\n\nUpdate the XR Plugin with the new screen param files\n----------------------------------------------------\n\nIf the XR Plugin is being used, it is required to generate a new\n`GfxPluginCardboard.a` with the updated `screen_params.mm` file.\n\nFollow the steps in the \"Download and build the demo app\" section from the\n[Quickstart](https://developers.google.com/cardboard/develop/ios/quickstart#download_and_build_the_demo_app)\nup to step 2 to open `Cardboard.xcworkspace` workspace in XCode. Select the sdk\nmodule and then **Generic iOS Device** as the target device (or choose to build\nfor a specific phone if that suits your needs better). Build the sdk module,\ncopy the generated `.a` file and replace the `GfxPluginCardboard.a` file in\n[cardboard-xr-plugin/Runtime/iOS/](https://github.com/googlevr/cardboard-xr-plugin/tree/master/Runtime/iOS)."]]