swift check if running on simulator code example
Example: swift test if simulator
#if targetEnvironment(simulator)
// your simulator code
#else
// your real device code
#endif
#if targetEnvironment(simulator)
// your simulator code
#else
// your real device code
#endif