Show device name for iOS Simulator

grigory.entin's Avatar

grigory.entin

15 Aug, 2018 02:36 PM

Currently "the app switcher" shows just " iOS Simulator ()" for every "available" app, and if I run same app in two different simulators (and same iOS version), there's basically no way to tell what is what - the only workaround is to use different versions of iOS for simulator, but that's not always possible.

  1. Support Staff 1 Posted by Vlas Voloshin on 17 Aug, 2018 12:38 AM

    Vlas Voloshin's Avatar

    Hi Grigory,

    This is indeed a great suggestion – we did receive a similar one some time ago. In fact, this problem became more prominent with Xcode 9's full support of multiple simulators launched at the same time. Unfortunately, since iOS doesn't report the same simulator name via UIKit as Xcode does, it might be tricky (though not impossible) to extract the names you'd expect to see, so I can't promise you any particular timeframe when this feature would be implemented. But we'll definitely look into it, thanks for your feedback!

    Best regards,
    Vlas.

  2. 2 Posted by grigory.entin on 17 Aug, 2018 07:10 PM

    grigory.entin's Avatar

    Hi, I believe you can get the simulated model from process environment like below:

    (lldb) po NSProcessInfo.processInfo.environment[@"SIMULATOR_MODEL_IDENTIFIER"]
    iPhone6,1
    
    Credits to https://github.com/sag333ar/SKDeviceType/blob/master/Device/DeviceT...
  3. Support Staff 3 Posted by Vlas Voloshin on 18 Aug, 2018 07:05 AM

    Vlas Voloshin's Avatar

    Hi Grigory,

    Thanks for the tip – this looks like a great idea! In fact, it turns out simulator environment contains a few more useful variables, and a somewhat more sustainable and precise option for us would be to use SIMULATOR_DEVICE_NAME, since it contains a human-readable device name and doesn't require to keep Model ID mapping up to date.

    I'll include this information in our internal task list, and hopefully this solution will make implementing this feature much more feasible.

    Best regards,
    Vlas.

  4. 4 Posted by grigory.entin on 18 Aug, 2018 11:21 AM

    grigory.entin's Avatar

    Great! Thanks a lot!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac