I'm not sure this is adequate to detect if you're running in the simulator since we have shims for this.