title: React Native: How can I detect if my code is running in the Simulator?
body: <p>In a Obj-C iOS app I can use <code>#if (TARGET_IPHONE_SIMULATOR)</code> to write simulator-only code.</p>
  
  <p>In react native I can use:</p>
  
  <pre><code>if (__DEV__) {
   .. do something special
  }
  </code></pre>
  
  <p>.. to detect development mode.  </p>
  
  <p>We can use <code>Platform.OS === 'ios'</code> to detect the platform (Android/iOS).
  See here for more info <a href="https://facebook.github.io/react-native/docs/platform-specific-code.html">Platform Docs</a></p>
  
  <p>But how do we detect if the app is running in the simulator?</p>
  
  <p>The reason I ask is that my app uses the camera to scan barcodes, and this isn't supported in the iOS Simulator.</p>