in the Simulator, it’ll return “x86_64”, but on actual iOS devices, it’ll return the full device identifier, i.e. iPhone8,1 or iPhone10,6
here’s an unofficial list of device identifiers: https://gist.github.com/adamawolf/3048717
Not sure what this will return on simulator as not tried, but returns either iPad or iPhone on devices. Not sure if any further detail is available with different calls.
Instead of returning iPhone or iPad it’ll now return something like iPhone7, 2 for e.g. an iPhone 6 so it shouldn’t break anything and just adds some extra info.
I can add something to the breaking changes doc for this, but it’s just a matter of changing your comparison from SystemStats::getDeviceDescription() == "iPhone"; to SystemStats::getDeviceDescription().contains ("iPhone");
Yes, I agree - but as the change will be a silent one when people pull from dev (or main branch once it moves over) then they’re not going to know unless it’s listed as a breaking change. I only know because I happen to have posted on this mail, otherwise when I next pull from dev I’d have had to hunt for the break…
After you pull the latest tip from develop, why wouldn’t you read the commit messages to see what’s been updated? That’s the easiest way to know if a change is breaking without requiring a special alert from the JUCE team, no?
well, sometimes i go weeks without pulling so there’s a lot to go through - and there’s also the person who pulls from master once every 6 months - are they really going to read every commit comment?
I thought the purpose of the breaking changes announcements was to alert people to things in their code that silently (i.e. no compiler errors) will behave differently. It really was only a suggestion…
Hey there
I found this thread whilst searching for a solution. I’m finding that when I run on iPhone
Simulator with XCode the device is returned from SystemStats::getDeviceDescriotion as: x86_64
This is per @matkatmusic’s initial post. My question is how are people testing to see what the iPhone version is when working with Simulators?
if (auto* simDeviceName = [userInfo objectForKey: @"SIMULATOR_DEVICE_NAME"])
to if (auto* simDeviceName = [userInfo objectForKey: @"SIMULATOR_MODEL_IDENTIFIER"])
This way the returned description string is consistent with the behaviour on a physical device. eg. iPhone Xs returns as “iPhone11,2” on both a phone and simulator. Currently the simulator returns “iPhone Xs”.