Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine different simulators i.e. iPhone 6 and iPhone 6 plus #23

Closed
mcphersonjr opened this issue Apr 15, 2015 · 3 comments
Closed

Determine different simulators i.e. iPhone 6 and iPhone 6 plus #23

mcphersonjr opened this issue Apr 15, 2015 · 3 comments

Comments

@mcphersonjr
Copy link

Just thought I would bring up the issue of being able to determine the simulator hardware as a specific device rather than just "Simulator". One reason I bring this up is because in my application I need to present information to the user and change it depending on their device/screen size. I don't have an iPhone 6 plus to test the layout of the information on, and I need to use the simulator.

By the way, thanks for developing this utility.

@InderKumarRathore
Copy link
Owner

Hi Cedric McPherson,
For simulators we're getting the same string thus we can't differentiate between iPhone 6 and iPhone 6 Plus simulator. We can only know that it's a simulator.

@ghost
Copy link

ghost commented Oct 25, 2018

@InderKumarRathore You can get the model identifier from the simulator as follows:

if ([hardware isEqualToString:i386_Sim] || [hardware isEqualToString:x86_64_Sim]) { hardware = [[[NSProcessInfo processInfo] environment] objectForKey:@"SIMULATOR_MODEL_IDENTIFIER"]; }

@InderKumarRathore
Copy link
Owner

Thanks @mrzystem , Made changes related to it and pushed to 4.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants