Search Issue Tracker
Fixed in 2018.1
iPhone X has wrong Device enumeration
_DeviceModel in UnityDeviceModel() in DeviceSettings.mm is returning the wrong value for an iPhoneX, so UnityEngine.iOS.Device.generation is returning the incorrect enum for an iPhoneX. It returns iPhone8Plus.
_DeviceModel is returning iPhone10,6 for my iPhoneX, but the test in UnityDeviceGeneration() in that same file, DeviceSettings.mm assumes 10,6 is iPhone8Plus.
Change the code at line 96 of that file in an iOS build to have an NSLog at the end, to say :
extern "C" const char* UnityDeviceModel()
static const char* _DeviceModel = NULL;
if (_DeviceModel == NULL)
::sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char* model = (char*)::malloc(size + 1);
::sysctlbyname("hw.machine", model, &size, NULL, 0);
model[size] = 0;
_DeviceModel = AllocCString([NSString stringWithUTF8String: model]);
NSLog(@"device model: %s", _DeviceModel);
this returns iPhone10,6, which is tested in DeviceSettings.mm :
else if (!strncmp(model, "iPhone10,2", 10) || !strncmp(model, "iPhone10,6", 10))
_DeviceGeneration = deviceiPhone8Plus;
which is incorrect.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- "Recalculate Lightmap Scale" makes LOD scale in lightmap be based on the least detailed LOD instead of the highest
- Fatal Error "CheckDisalowAllocation" when reimporting more than 10 files with at least one .PO file
- [Vulkan] Adreno 540 and older omits interlocked operations when ComputeBuffer is longer then 65520 * sizeof(int)
- [Vulkan] Wrong aspect ratio in fullscreen of Standalone build when selected screen resolution is not native
- [iOS 12] [Metal] IOAF code 4 error freeze because of tessellation shader