How to detect Xcode simulator vs real iOS device?

Is there a way in Corona to detect whether my app is running in the Xcode simulator? The reason I ask this is that Admob V2 ads will show test ads in the Xcode sim, but on my iPhone the testMode flag has no effect so it shows the real ads. So I just want to see the ads if it is running on the Xcode simulator.

Using system.getInfo(“environment”) I can detect the Corona simulator but not the Xcode simulator.

Okay, I think I’ve figured it out.  I just need to make a call for system.getInfo(“architectureInfo”).   

On my Mac, if I’m using either the Corona sim or the Xcode sim, they will both return “x86_64” for the architectureInfo (of course, this value would be different if you’re using an older Mac or Windows desktop).

On a non-simulator mobile device, it would return something different… so if I was using an iPhone 6 Plus, it would return “iPhone7,1”.

More info here:

https://docs.coronalabs.com/api/library/system/getInfo.html

Okay, I think I’ve figured it out.  I just need to make a call for system.getInfo(“architectureInfo”).   

On my Mac, if I’m using either the Corona sim or the Xcode sim, they will both return “x86_64” for the architectureInfo (of course, this value would be different if you’re using an older Mac or Windows desktop).

On a non-simulator mobile device, it would return something different… so if I was using an iPhone 6 Plus, it would return “iPhone7,1”.

More info here:

https://docs.coronalabs.com/api/library/system/getInfo.html