Page Summary
-
The Cardboard SDK requires updating
screen_params.mmannually to work with new iOS devices. -
Information for updating
screen_params.mm, such as model strings and DPI values, can be found on websites like theapplewiki.com and Apple's technical specifications pages. -
It is recommended to review the history of
screen_paramsto ensure accurate updates are being made. -
If using the XR Plugin, a new
GfxPluginCardboard.afile needs to be generated with the updatedscreen_params.mm.
Each year, new iOS devices are released. To make the Cardboard SDK or Cardboard
XR Plugin work with these new devices, update the resolutions.csv file for the
project you are using.
Source of information
- Model strings can be obtained from The Apple Wiki.
- DPI (also called PPI) values can be obtained from Apple's technical specifications (for example, see iPhone 16 specifications).
What needs to be updated
Depending on whether you are using the Cardboard SDK or the Cardboard XR Plugin,
update the corresponding resolutions.csv file:
- Cardboard SDK:
sdk/qrcode/ios/sdk.bundle/resolutions.csv - Cardboard XR Plugin:
Runtime/iOS/sdk.bundle/resolutions.csv
Both load device screen parameters dynamically at runtime from resolutions.csv
inside sdk.bundle.
- When contributing new device parameters upstream to Google Cardboard, submit
pull requests to both the Cardboard SDK and Cardboard XR Plugin repositories
(they are kept in sync using
LINT.IfChange/LINT.ThenChange). - For local Unity projects using immutable UPM packages in
Library/PackageCache/, developers can editresolutions.csvdirectly inside the exported Xcode project underFrameworks/com.google.xr.cardboard/Runtime/iOS/sdk.bundle/resolutions.csv.
Format of resolutions.csv
Add a new line for each device using the following comma-separated format:
identifier,device_name,dpis
identifier: The hardware model string obtained from The Apple Wiki, with any comma replaced by a dot (for example,iPhone17,3becomesiPhone17.3).device_name: The marketing name of the device (for example,iPhone 16). This must not contain commas, as the runtime parser (stringSplitinscreen_params.mm) splits on commas into a fixed 3-element array without quoting support; an embedded comma would displace the DPI token and cause it to evaluate to0.0.dpis: The screen pixel density in DPI/PPI followed byf(for example,460.0f).
Example entries
iPhone17.3,iPhone 16,460.0f
iPhone17.4,iPhone 16 Plus,460.0f
iPhone17.1,iPhone 16 Pro,460.0f
iPhone17.2,iPhone 16 Pro Max,460.0f